Skip to content

Commit 1bccb80

Browse files
nobutmm1
authored andcommitted
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 ruby#9315] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 7eb570d commit 1bccb80

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/ruby/test_super.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,4 +422,22 @@ def foo
422422
b.new.method(:foo).call
423423
end
424424
end
425+
426+
def test_module_super_in_method_module
427+
bug9315 = '[ruby-core:59589] [Bug #9315]'
428+
a = Module.new do
429+
def foo
430+
super
431+
end
432+
end
433+
c = Class.new do
434+
def foo
435+
:ok
436+
end
437+
end
438+
o = c.new.extend(a)
439+
assert_nothing_raised(NoMethodError, bug9315) do
440+
assert_equal(:ok, o.method(:foo).call, bug9315)
441+
end
442+
end
425443
end

0 commit comments

Comments
 (0)