summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-08 13:53:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-08 13:53:18 +0000
commit5c0d17c9a2fbbb60e24cd6bd41ffdf8b63b07318 (patch)
tree679385a31a6805ce4f33e6299c023c52ea41a86c /test
parentfe46b2d5f05057dd2d238d71fc2276406d259cef (diff)
vm_insnhelper.c: revive r44455 for bound module method
* vm_insnhelper.c (vm_search_super_method): when super called in a bound UnboundMethod generated from a module, no superclass is found since the current defined class is the module, then call method_missing in that case. [ruby-core:59619] [Bug #9377] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_super.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb
index c5f724ebb8..30cc3d8e86 100644
--- a/test/ruby/test_super.rb
+++ b/test/ruby/test_super.rb
@@ -440,4 +440,17 @@ class TestSuper < Test::Unit::TestCase
assert_equal(:ok, o.method(:foo).call, bug9315)
end
end
+
+ def test_missing_super_in_module_unbound_method
+ bug9377 = '[ruby-core:59619] [Bug #9377]'
+
+ a = Module.new do
+ def foo; super end
+ end
+
+ m = a.instance_method(:foo).bind(Object.new.extend(a))
+ assert_raise(NoMethodError, bug9377) do
+ m.call
+ end
+ end
end