From fa7c4ab4084ac6d5ad615d133ab0dcaca2c817fb Mon Sep 17 00:00:00 2001 From: shugo Date: Mon, 10 Dec 2012 13:02:54 +0000 Subject: * 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 --- test/ruby/test_refinement.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test') 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 -- cgit v1.2.3