summaryrefslogtreecommitdiff
path: root/test/ruby/test_refinement.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-10 03:39:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-10 03:39:31 +0000
commit67129c8383f382eddd805411ef619d5c8c258dc3 (patch)
tree4c4db72dfa8de0712003b3481e6b50fb499c3379 /test/ruby/test_refinement.rb
parent9d9dfc217240613e6e64f314d888b94fd9c80a4e (diff)
class.c: exclude refined methods
* class.c (method_entry_i): should exclude refined methods from instance method list. [ruby-core:57080] [Bug #8881] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_refinement.rb')
-rw-r--r--test/ruby/test_refinement.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb
index 02193ae615..60681b2f1a 100644
--- a/test/ruby/test_refinement.rb
+++ b/test/ruby/test_refinement.rb
@@ -1005,6 +1005,17 @@ class TestRefinement < Test::Unit::TestCase
end;
end
+ def test_instance_methods
+ bug8881 = '[ruby-core:57080] [Bug #8881]'
+ assert_not_include(Foo.instance_methods(false), :z, bug8881)
+ assert_not_include(FooSub.instance_methods(true), :z, bug8881)
+ end
+
+ def test_method_defined
+ assert_not_send([Foo, :method_defined?, :z])
+ assert_not_send([FooSub, :method_defined?, :z])
+ end
+
private
def eval_using(mod, s)