diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_eval.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_eval.rb b/test/ruby/test_eval.rb index 2700aa33f3..28d797e2c8 100644 --- a/test/ruby/test_eval.rb +++ b/test/ruby/test_eval.rb @@ -484,4 +484,19 @@ class TestEval < Test::Unit::TestCase assert_same a, b end + + def test_gced_binding_block + assert_normal_exit %q{ + def m + binding + end + GC.stress = true + b = nil + tap do + b = m {} + end + 0.times.to_a + b.eval('yield') + }, '[Bug #10368]' + end end |