diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-19 16:58:53 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-19 16:58:53 +0000 |
commit | 4bcae05f01915183e7bc525c0f2e4682a0ec40e0 (patch) | |
tree | 60767e3a8b5fb654f49b992b03a2b1c1cacd67ce /test | |
parent | ee2df505d8ee589a7778bf5723e701ec171362d3 (diff) |
merge revision(s) r44527: [Backport #9377]
* 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/branches/ruby_2_0_0@45051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_super.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb index a7a3840d50..87cb3791ca 100644 --- a/test/ruby/test_super.rb +++ b/test/ruby/test_super.rb @@ -441,4 +441,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 |