add find method to indexed

This commit is contained in:
Torsten Ruger
2016-12-15 14:00:03 +02:00
parent b93f207638
commit 2b3f9c398e
2 changed files with 19 additions and 0 deletions

View File

@ -137,6 +137,15 @@ class TestList < MiniTest::Test
end
assert_equal 2 , counter
end
def test_find
@list.set(1,1)
@list.set(2,2)
assert_equal 2, @list.find{|i| i == 2}
end
def test_not_find
@list.set(1,1)
assert_nil @list.find{|i| i == 3}
end
def test_delete_at
test_many_get
assert @list.delete_at 2