summaryrefslogtreecommitdiff
path: root/test/ruby/test_enumerator.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_enumerator.rb')
-rw-r--r--test/ruby/test_enumerator.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_enumerator.rb b/test/ruby/test_enumerator.rb
index 07f10dd041..e3270f3d6a 100644
--- a/test/ruby/test_enumerator.rb
+++ b/test/ruby/test_enumerator.rb
@@ -419,6 +419,11 @@ class TestEnumerator < Test::Unit::TestCase
a = []
assert_equal(:foo, g2.each {|x| a << x })
assert_equal([1, 2, 3], a)
+
+ g.freeze
+ assert_raise(RuntimeError) {
+ g.__send__ :initialize, proc { |y| y << 4 << 5 }
+ }
end
def test_generator_args