From b511e1bfbe649b938e317e00ad1795f1b9623758 Mon Sep 17 00:00:00 2001 From: mame Date: Fri, 28 Jan 2011 17:57:48 +0000 Subject: * variable.c (rb_mod_const_of, sv_i): Module#constant should exclude private constants. see [ruby-core:32912]. * test/ruby/test_module.rb (test_constants_with_private_constant): add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_module.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/ruby/test_module.rb') diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index e3b433e2cb..c7acac05f9 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -981,4 +981,8 @@ class TestModule < Test::Unit::TestCase c.public_constant(:FOO) assert_equal("foo", c::FOO) end + + def test_constants_with_private_constant + assert(!(::TestModule).constants.include?(:PrivateClass)) + end end -- cgit v1.2.3