diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-04 07:45:29 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-04 07:45:29 +0000 |
commit | dc3ea52e1c0f9b673ef45f96c42bf393c24890e8 (patch) | |
tree | f791f1d8bc1b2872f8697fab219ef5247ce50fc3 /test/ruby | |
parent | a44f7a3ee672352781c614e46b91f6212321d561 (diff) | |
download | ruby-dc3ea52e1c0f9b673ef45f96c42bf393c24890e8.tar.gz |
* 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
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_refinement.rb | 25 |
1 files changed, 25 insertions, 0 deletions
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) |