aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_super.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_super.rb')
-rw-r--r--test/ruby/test_super.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb
index fcf5773501..e7825560ac 100644
--- a/test/ruby/test_super.rb
+++ b/test/ruby/test_super.rb
@@ -452,4 +452,28 @@ class TestSuper < Test::Unit::TestCase
m.call
end
end
+
+ def test_super_in_module_unbound_method
+ bug9721 = '[ruby-core:61936] [Bug #9721]'
+
+ a = Module.new do
+ def foo(result)
+ result << "A"
+ end
+ end
+
+ b = Module.new do
+ def foo(result)
+ result << "B"
+ super
+ end
+ end
+
+ m = b.instance_method(:foo).bind(Object.new.extend(a))
+ result = []
+ assert_nothing_raised(NoMethodError, bug9721) do
+ m.call(result)
+ end
+ assert_equal(%w[B A], result, bug9721)
+ end
end