* test/ruby/test_enumerator.rb: Add test to shed light upon the bug

which made by r37498. See http://bugs.ruby-lang.org/issues/7298

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ayumin 2012-11-07 15:51:00 +00:00
parent 94cd486b51
commit 0ab21f9572

View File

@ -67,6 +67,9 @@ class TestEnumerator < Test::Unit::TestCase
assert_match 'Enumerator.new without a block is deprecated', err
assert_equal([1, 2, 3], Enumerator.new { |y| i = 0; loop { y << (i += 1) } }.take(3))
assert_raise(ArgumentError) { Enumerator.new }
assert_equal([1, 2, 3], Enumerator.new([1, 2, 3]).take(3))
bug7298 = '[ruby-core:49001]'
assert_equal([4, 5, 6], Enumerator.new([4, 5, 6]){|y| i = 0; loop { y << (i+=1) } }.take(3))
end
def test_initialize_copy