From 24c3331bdfa47339de70e5866132bf872e6d9d90 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 28 Dec 2013 23:21:14 +0000 Subject: 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 --- test/ruby/test_super.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test') 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 -- cgit v1.2.3