summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-11 17:19:28 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-11 17:19:28 +0000
commit047b553920b55fa5efbabd5f8a31b1a8bf829f45 (patch)
tree1438d1f0f29ec94f7c792df9e5fa3eabc33f7c13 /test/ruby
parenta5d40b289fde6afec9341af04642d4d3c3c8be28 (diff)
merge revision(s) 39742,39743: [Backport #8005]
assertions.rb: private flag * lib/test/unit/assertions.rb (assert_respond_to): accept optional include-private flag. * 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/branches/ruby_2_0_0@40252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-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 5450c8ff3a..1e0f154bd2 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)