diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-29 08:39:47 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-29 08:39:47 +0000 |
commit | 7735502d2c6d838c45e5fdb962e4dc2796f495aa (patch) | |
tree | 0f1105b25838af01509484dc66f3b7d2b48d3979 /test/ruby | |
parent | 684bdf6171b76f5bc5e4f05926a5ab01ec2b4fd5 (diff) |
Unused module refinement shouldn't break method search.
Use rb_callable_method_entry_t::defined_class instead of
rb_callable_method_entry_t::owner, because the superclass of iclass
should be searched for modules. [ruby-core:83613] [Bug #14068]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_refinement.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index 5fba208fb7..2386b54dec 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -2010,6 +2010,32 @@ class TestRefinement < Test::Unit::TestCase assert_equal(:foo, ToSymbol.new("foo").symbol) end + def test_unused_refinement_for_module + bug14068 = '[ruby-core:83613] [Bug #14068]' + assert_in_out_err([], <<-INPUT, ["M1#foo"], [], bug14068) + module M1 + def foo + puts "M1#foo" + end + end + + module M2 + end + + module UnusedRefinement + refine(M2) do + def foo + puts "M2#foo" + end + end + end + + include M1 + include M2 + foo() + INPUT + end + private def eval_using(mod, s) |