Skip to content

Commit

Permalink
Add some tests (#1240)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adan Amarillas authored and vbrazo committed May 22, 2018
1 parent fe586fb commit 1380eb2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions test/test_faker_company.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ def test_polish_register_of_national_economy
assert control_number == number[13].to_i
end

def test_mod11
assert @tester.send(:mod11, 0)
end

private

def abn_checksum(abn)
Expand Down
2 changes: 1 addition & 1 deletion test/test_faker_measurement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def setup
@tester = Faker::Measurement
end

def height
def test_height
assert @tester.height.match(/\d\s[a-z]/)
assert @tester.height(1).match(/\d\s[a-z]/)
end
Expand Down
7 changes: 7 additions & 0 deletions test/test_faker_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,11 @@ def test_titleize
expected = 'Foobar'
assert @tester.send(:titleize, val) == expected
end

def test_resolve
array = [1, 2, 3]
range = 1..10
assert array.include?(@tester.send(:resolve, array))
assert range.include?(@tester.send(:resolve, range))
end
end

0 comments on commit 1380eb2

Please sign in to comment.