summaryrefslogtreecommitdiff
path: root/test/ruby/test_module.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-13 05:51:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-13 05:51:32 +0000
commitbe909b5e95e5ba56eadb42e6dbc9102c1188ae48 (patch)
tree3a7b71665e487ecab7322ec9b6f72164fe79767a /test/ruby/test_module.rb
parent49a22e173b8d8e95eb3b891669329b8a07c43e70 (diff)
vm_method.c: overrid flag of prepending method
* vm_method.c (rb_export_method): directly override the flag of method defined in prepending class too, not adding zsuper entry. [ruby-core:53106] [Bug #8005] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_module.rb')
-rw-r--r--test/ruby/test_module.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index af3150b8a0..fa7484b10a 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -1489,6 +1489,18 @@ class TestModule < Test::Unit::TestCase
assert_equal(0, 1 / 2)
end
+ def test_prepend_visibility
+ bug8005 = '[ruby-core:53106] [Bug #8005]'
+ c = Class.new do
+ prepend Module.new {}
+ def foo() end
+ protected :foo
+ end
+ a = c.new
+ assert_respond_to a, [:foo, true]
+ assert_nothing_raised(NoMethodError) {a.send :foo}
+ end
+
def test_class_variables
m = Module.new
m.class_variable_set(:@@foo, 1)