diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-28 17:57:42 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-28 17:57:42 +0000 |
commit | b1e829fb30be8a1a5c842a981ed9eacf9c77b1a3 (patch) | |
tree | afb1bf63e88cd56f765d0e6023d0b2df68c7e5e2 /test | |
parent | a2ec8666cf8fbb579fa48c73bd114908dbbc4a85 (diff) | |
download | ruby-b1e829fb30be8a1a5c842a981ed9eacf9c77b1a3.tar.gz |
* variable.c (rb_const_set): const_set shoud preserve constant
visibility. see [ruby-core:32912].
* test/ruby/test_module.rb: add a test for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_module.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 3306c0db74..e3b433e2cb 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -948,6 +948,10 @@ class TestModule < Test::Unit::TestCase assert_raise(NameError) { c::FOO } assert_equal("foo", c.class_eval("FOO")) assert_equal("foo", c.const_get("FOO")) + $VERBOSE, verbose = nil, $VERBOSE + c.const_set(:FOO, "foo") + $VERBOSE = verbose + assert_raise(NameError) { c::FOO } end class PrivateClass |