aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-19 01:27:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-19 01:27:52 +0000
commit7bcd7b09cb8d586fb9cf74134ea796b86d900b75 (patch)
treec206d8f5666907abb3f3b47961d5860b0466176c /test/ruby
parentbdd3f9353b565c0cbc1324910cef76b0ccf0aef0 (diff)
downloadruby-7bcd7b09cb8d586fb9cf74134ea796b86d900b75.tar.gz
vm_insnhelper.c: super to module in refinement
* vm_insnhelper.c (vm_call_zsuper): method defined in module in refinement is not callable as-is. dispatch again. [ruby-core:79588] [Bug #13227] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_refinement.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb
index 66202cda11..a178f24591 100644
--- a/test/ruby/test_refinement.rb
+++ b/test/ruby/test_refinement.rb
@@ -1829,6 +1829,38 @@ class TestRefinement < Test::Unit::TestCase
end;
end
+ module SuperToModule
+ class Parent
+ end
+
+ class Child < Parent
+ end
+
+ module FooBar
+ refine Parent do
+ def to_s
+ "Parent"
+ end
+ end
+
+ refine Child do
+ def to_s
+ super + " -> Child"
+ end
+ end
+ end
+
+ using FooBar
+ def Child.test
+ new.to_s
+ end
+ end
+
+ def test_super_to_module
+ bug = '[ruby-core:79588] [Bug #13227]'
+ assert_equal("Parent -> Child", SuperToModule::Child.test, bug)
+ end
+
private
def eval_using(mod, s)