mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
15bd216c7c
commit
7dfbcc85d2
1 changed files with 18 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue