summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-12 13:46:55 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-12 13:46:55 +0000
commit35c827a6056c8762aff29d4303cbe6131f338e5a (patch)
tree3fe254bdbc2b9b98f723980b8f5c3bedb100c0ca /test/ruby
parent91036252bb18b6773a8c8e4190623d659261e4a5 (diff)
merge revision(s) 57655: [Backport #13227]
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/branches/ruby_2_4@57907 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)