summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-23 14:32:49 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-23 14:32:49 +0000
commitc967493b653c9af32f9850876f4ff145add33d77 (patch)
tree336ad5223d74b44df57efe4b9a0a81965b292924 /test
parent96de351eed005e27aee3c11005aa53e0d0b5133c (diff)
merge revision(s) 40346: [Backport #8284]
* vm_method.c (rb_mod_public_method): fix visibility on anonymous module. set visibility of singleton method, not method in base class. [ruby-core:54404] [Bug #8284] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@40427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_module.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index 1e0f154bd2..06c1820853 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -1675,6 +1675,13 @@ class TestModule < Test::Unit::TestCase
end
end
+ def test_anonymous_module_public_class_method
+ bug8284 = '[ruby-core:54404] [Bug #8284]'
+ assert_raise(NoMethodError) {Object.define_method}
+ Module.new.public_class_method(:define_method)
+ assert_raise(NoMethodError, bug8284) {Object.define_method}
+ end
+
private
def assert_top_method_is_private(method)