diff options
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_super.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb index 51819667ee..d1795d2a34 100644 --- a/test/ruby/test_super.rb +++ b/test/ruby/test_super.rb @@ -149,4 +149,25 @@ class TestSuper < Test::Unit::TestCase c = C.new assert_equal([c, "#{c.to_s}::m"], c.m, bug2419) end + + module Bug2537 + class Parent + def run(a) + a + end + end + + class Child < Parent + def run(*a) + proc {super(*a)}.call + end + end + end + + def test_super_in_block_call + bug2537 = '[ruby-dev:39931]' + assert_nothing_raised(bug2537) do + assert_equal(bug2537, Bug2537::Child.new.run(bug2537), bug2537) + end + end end |
