summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-29 17:47:47 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-29 17:47:47 +0000
commit7298ae9e4bcef612009d3aa0caba4fde3276a7f3 (patch)
treee9c5df29cc07c9c4b8de3b4493b6651636e9828f /test/ruby
parent6875e3242f967995f89cf38fae05f4744be1f66f (diff)
Make Module#attr{accessor|reader|writer|} public [#14132]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60940 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 d1c5d53822..29236644bf 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -2030,6 +2030,18 @@ class TestModule < Test::Unit::TestCase
assert_raise(NameError){ m.instance_eval { remove_const(:__FOO__) } }
end
+ def test_public_methods
+ public_methods = %i[
+ include
+ prepend
+ attr
+ attr_accessor
+ attr_reader
+ attr_writer
+ ]
+ assert_equal public_methods.sort, (Module.public_methods & public_methods).sort
+ end
+
def test_private_top_methods
assert_top_method_is_private(:include)
assert_top_method_is_private(:public)