aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_super.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-28 23:21:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-28 23:21:14 +0000
commit24c3331bdfa47339de70e5866132bf872e6d9d90 (patch)
treeab2a6e50338fedcb0478b2b51aa518869f2d99f4 /test/ruby/test_super.rb
parente521a19aa4ac1a7b05bb9bea2af09a8016931de9 (diff)
downloadruby-24c3331bdfa47339de70e5866132bf872e6d9d90.tar.gz
vm_insnhelper.c: missing super in method module
* vm_insnhelper.c (vm_search_super_method): direct superclass of a module is found when super called in a Method object generated a method defined in a module, call method_missing in that case. [ruby-core:59358] [Bug #9315] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_super.rb')
-rw-r--r--test/ruby/test_super.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb
index 846f40946d..b518aa2914 100644
--- a/test/ruby/test_super.rb
+++ b/test/ruby/test_super.rb
@@ -407,4 +407,19 @@ class TestSuper < Test::Unit::TestCase
assert_equal([false, false], y.foo(false, false))
assert_equal([1, 2, 3, false, 5], y.foo(1, 2, 3, false, 5))
end
+
+ def test_missing_super_in_method_module
+ bug9315 = '[ruby-core:59358] [Bug #9315]'
+ a = Module.new do
+ def foo
+ super
+ end
+ end
+ b = Class.new do
+ include a
+ end
+ assert_raise(NoMethodError, bug9315) do
+ b.new.method(:foo).call
+ end
+ end
end