summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-28 06:48:20 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-28 06:48:20 +0000
commitde14055d62da51b91f9883ae1b3af2ae247565be (patch)
treeffde2455117a6526933ef58ba6da4442231caf42 /test
parente3990633cb2e44f19588c16a436516a8ecae0459 (diff)
* vm_method.c (search_method): copy refinement iclasses to search
superclasses correctly. * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_refinement.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb
index ac6df929f0..98645745e9 100644
--- a/test/ruby/test_refinement.rb
+++ b/test/ruby/test_refinement.rb
@@ -361,6 +361,24 @@ class TestRefinement < Test::Unit::TestCase
assert_equal([:m1, :m2], m2.module_eval { obj.foo })
end
+ def test_refine_module_and_call_superclass_method
+ m1 = Module.new
+ c1 = Class.new {
+ def foo
+ "c1#foo"
+ end
+ }
+ c2 = Class.new(c1) {
+ include m1
+ }
+ m2 = Module.new {
+ refine m1 do
+ end
+ }
+ obj = c2.new
+ assert_equal("c1#foo", m2.module_eval { obj.foo })
+ end
+
def test_refine_neither_class_nor_module
assert_raise(TypeError) do
Module.new {