From 7dfbcc85d2e31fcb9af50c66486e82e1bc4dc2df Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 6 Jan 2014 14:34:18 +0000 Subject: test_super.rb: test_module_super_in_method_module * test/ruby/test_super.rb (test_module_super_in_method_module): more test for the case searching super method from a method defined in a module. [ruby-core:59589] [Bug #9315] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_super.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb index b518aa2914..c5f724ebb8 100644 --- a/test/ruby/test_super.rb +++ b/test/ruby/test_super.rb @@ -422,4 +422,22 @@ class TestSuper < Test::Unit::TestCase b.new.method(:foo).call end end + + def test_module_super_in_method_module + bug9315 = '[ruby-core:59589] [Bug #9315]' + a = Module.new do + def foo + super + end + end + c = Class.new do + def foo + :ok + end + end + o = c.new.extend(a) + assert_nothing_raised(NoMethodError, bug9315) do + assert_equal(:ok, o.method(:foo).call, bug9315) + end + end end -- cgit v1.2.3