summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-10 13:02:54 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-10 13:02:54 +0000
commitfa7c4ab4084ac6d5ad615d133ab0dcaca2c817fb (patch)
tree273489725ac34facac030ee3f5d48ab6ddf4b63e /test
parenta263a8567a3c0ea3bdd3b3fc10f0880aa23d85b3 (diff)
* vm_method.c (rb_method_entry_without_refinements): use
rb_resolve_refined_method() to search superclasses if me->def->orig_me is 0. This change fixes make test-all TESTS="json ruby/test_refinement.rb". * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_refinement.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb
index 97f6db9303..17896eb01d 100644
--- a/test/ruby/test_refinement.rb
+++ b/test/ruby/test_refinement.rb
@@ -129,11 +129,30 @@ class TestRefinement < Test::Unit::TestCase
assert_raise(NoMethodError) { foo.z }
end
+ module RespondTo
+ class Super
+ def foo
+ end
+ end
+
+ class Sub < Super
+ end
+
+ module M
+ refine Sub do
+ def foo
+ end
+ end
+ end
+ end
+
def test_send_should_not_use_refinements
foo = Foo.new
assert_raise(NoMethodError) { foo.send(:z) }
assert_raise(NoMethodError) { FooExtClient.send_z_on(foo) }
assert_raise(NoMethodError) { foo.send(:z) }
+
+ assert_equal(true, RespondTo::Sub.new.respond_to?(:foo))
end
def test_method_should_not_use_refinements