1
0
mirror of https://github.com/danbee/inny synced 2025-03-04 08:59:10 +00:00
inny/test/inny_test.rb
2015-09-24 12:06:06 +01:00

30 lines
613 B
Ruby

require 'test_helper'
class InnyTest < Minitest::Test
def test_that_it_has_a_version_number
refute_nil ::Inny::VERSION
end
def test_it_finds_integers
assert 8.in?([7, 8, 9])
refute 8.in?([1, 2, 3])
end
def test_it_finds_strings
assert 'Egg'.in?(['Bacon', 'Sausage', 'Egg'])
refute 'Egg'.in?(['Apple', 'Orange', 'Banana'])
end
def test_it_finds_substrings
assert 'bar'.in?('Foobar')
refute 'egg'.in?('Foobar')
end
def test_it_finds_things_in_an_array
list = ['John', 'Jimmy', 'Robert']
assert 'Jimmy'.in?(list)
refute 'John Paul'.in?(list)
end
end