mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 22:14:37 +02:00
* enumerator.c (obj_to_enum): Have #to_enum accept a block
[Feature #6636] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
610eeffa46
commit
acfd34a6a9
2 changed files with 14 additions and 2 deletions
|
@ -410,6 +410,9 @@ class TestEnumerator < Test::Unit::TestCase
|
|||
assert_equal Float::INFINITY, Enumerator.new(Float::INFINITY){}.size
|
||||
assert_equal nil, Enumerator.new(nil){}.size
|
||||
assert_raise(TypeError) { Enumerator.new("42"){} }
|
||||
|
||||
assert_equal nil, @obj.to_enum(:foo, 0, 1).size
|
||||
assert_equal 2, @obj.to_enum(:foo, 0, 1){ 2 }.size
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue