From dc3ea52e1c0f9b673ef45f96c42bf393c24890e8 Mon Sep 17 00:00:00 2001 From: shugo Date: Wed, 4 Feb 2015 07:45:29 +0000 Subject: * class.c (method_entry_i, class_instance_method_list, rb_obj_singleton_methods): should not include methods of superclasses if recur is false. [ruby-dev:48854] [Bug #10826] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_refinement.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test/ruby/test_refinement.rb') diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index cb7c53f98d..3d703e5a3b 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -1362,6 +1362,31 @@ class TestRefinement < Test::Unit::TestCase end; end + module NotIncludeSuperclassMethod + class X + def foo + end + end + + class Y < X + end + + module Bar + refine Y do + def foo + end + end + end + end + + def test_instance_methods_not_include_superclass_method + bug10826 = '[ruby-dev:48854] [Bug #10826]' + assert_not_include(NotIncludeSuperclassMethod::Y.instance_methods(false), + :foo, bug10826) + assert_include(NotIncludeSuperclassMethod::Y.instance_methods(true), + :foo, bug10826) + end + private def eval_using(mod, s) -- cgit v1.2.3