Make Module#{define|alias|undef|remove}_method public [#14133]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
marcandre 2017-11-29 17:47:59 +00:00
parent 6186e5201a
commit 0c03a89ecd
4 changed files with 12 additions and 7 deletions

View file

@ -2038,6 +2038,10 @@ class TestModule < Test::Unit::TestCase
attr_accessor
attr_reader
attr_writer
define_method
alias_method
undef_method
remove_method
]
assert_equal public_methods.sort, (Module.public_methods & public_methods).sort
end
@ -2104,9 +2108,9 @@ class TestModule < Test::Unit::TestCase
def test_visibility_by_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}
assert_raise(NoMethodError) {Object.remove_const}
Module.new.public_class_method(:remove_const)
assert_raise(NoMethodError, bug8284) {Object.remove_const}
end
def test_include_module_with_constants_does_not_invalidate_method_cache