mirror of
https://github.com/ruby/ruby.git
synced 2025-09-23 20:44:00 +02:00
object.c: no nested symbol
* object.c (rb_mod_const_get): symbol cannot be nested constant name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7815cbd7d0
commit
f3b132faac
3 changed files with 11 additions and 2 deletions
|
@ -271,9 +271,10 @@ class TestModule < Test::Unit::TestCase
|
|||
|
||||
def test_nested_get_symbol
|
||||
const = [self.class, Other].join('::').to_sym
|
||||
assert_raise(NameError) {Object.const_get(const)}
|
||||
|
||||
assert_equal Other, Object.const_get(const)
|
||||
assert_equal User::USER, self.class.const_get([User, 'USER'].join('::'))
|
||||
const = [User, 'USER'].join('::').to_sym
|
||||
assert_raise(NameError) {self.class.const_get(const)}
|
||||
end
|
||||
|
||||
def test_nested_get_const_missing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue