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:
nobu 2012-12-22 11:31:13 +00:00
parent 7815cbd7d0
commit f3b132faac
3 changed files with 11 additions and 2 deletions

View file

@ -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