1
0
mirror of https://github.com/danbee/inny synced 2025-03-04 08:59:10 +00:00

Fix tests

This commit is contained in:
Dan Barber 2015-09-24 12:06:06 +01:00
parent 04539b69be
commit 6b9e118895

View File

@ -6,19 +6,24 @@ class InnyTest < Minitest::Test
end end
def test_it_finds_integers def test_it_finds_integers
assert 8.in?(1, 2, 3) == false assert 8.in?([7, 8, 9])
assert 8.in?(7, 8, 9) == true refute 8.in?([1, 2, 3])
end end
def test_it_finds_strings def test_it_finds_strings
assert 'Egg'.in?('Apple', 'Orange', 'Banana') == false assert 'Egg'.in?(['Bacon', 'Sausage', 'Egg'])
assert 'Egg'.in?('Bacon', 'Sausage', 'Egg') == true refute 'Egg'.in?(['Apple', 'Orange', 'Banana'])
end
def test_it_finds_substrings
assert 'bar'.in?('Foobar')
refute 'egg'.in?('Foobar')
end end
def test_it_finds_things_in_an_array def test_it_finds_things_in_an_array
list = ['John', 'Jimmy', 'Robert'] list = ['John', 'Jimmy', 'Robert']
assert 'John Paul'.in?(*list) == false assert 'Jimmy'.in?(list)
assert 'Jimmy'.in?(*list) == true refute 'John Paul'.in?(list)
end end
end end