summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-11 07:58:06 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-11 07:58:06 +0000
commit033a32b4c136033299a027416f9039b68b32065a (patch)
tree3c59dfbfc4bf41ebc7c090bc9aed7540e86d7f6c /test
parentfd0aaf71dcc7e43435564e8d735403c733434590 (diff)
* enum.c (enum_find_index): Add support for find_index(obj);
[ruby-dev:34313]. * array.c (rb_ary_index): Define find_index as an alias to index. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_enum.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ruby/test_enum.rb b/test/ruby/test_enum.rb
index 74f6e4e466..97b4ec468b 100644
--- a/test/ruby/test_enum.rb
+++ b/test/ruby/test_enum.rb
@@ -43,8 +43,10 @@ class TestEnumerable < Test::Unit::TestCase
end
def test_find_index
+ assert_equal(1, @obj.find_index(2))
assert_equal(1, @obj.find_index {|x| x % 2 == 0 })
assert_equal(nil, @obj.find_index {|x| false })
+ assert_raise(ArgumentError) { @obj.find_index(0, 1) }
end
def test_find_all