mirror of
https://github.com/ruby/ruby.git
synced 2025-09-24 04:54:01 +02:00
* 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
This commit is contained in:
parent
a2ec8666cf
commit
b1e829fb30
3 changed files with 18 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue