diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-06 17:10:20 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-06 17:10:20 +0000 |
commit | acfd34a6a9e6462ed05f74e07f204b98d93126ff (patch) | |
tree | 07e3aab9366f774a858aa19bfd3b409261a584f5 /test/ruby/test_enumerator.rb | |
parent | 610eeffa468f43c13fd374c53b5ed5cb5dd9c1b3 (diff) | |
download | ruby-acfd34a6a9e6462ed05f74e07f204b98d93126ff.tar.gz |
* 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
Diffstat (limited to 'test/ruby/test_enumerator.rb')
-rw-r--r-- | test/ruby/test_enumerator.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_enumerator.rb b/test/ruby/test_enumerator.rb index 0f19a4f8e7..8efc812fc5 100644 --- a/test/ruby/test_enumerator.rb +++ b/test/ruby/test_enumerator.rb @@ -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 |