diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_lazy_enumerator.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_lazy_enumerator.rb b/test/ruby/test_lazy_enumerator.rb index 94b16a2841..1108b93706 100644 --- a/test/ruby/test_lazy_enumerator.rb +++ b/test/ruby/test_lazy_enumerator.rb @@ -22,6 +22,12 @@ class TestLazyEnumerator < Test::Unit::TestCase assert_equal([1, 2, 3], [1, 2, 3].lazy.to_a) assert_equal([1, 2, 3], Enumerator::Lazy.new([1, 2, 3]){|y, v| y << v}.to_a) assert_raise(ArgumentError) { Enumerator::Lazy.new([1, 2, 3]) } + + a = [1, 2, 3].lazy + a.freeze + assert_raise(RuntimeError) { + a.__send__ :initialize, [4, 5], &->(y, *v) { y << yield(*v) } + } end def test_each_args |