summaryrefslogtreecommitdiff
path: root/test/ruby/test_module.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-22 11:31:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-22 11:31:13 +0000
commitf3b132faac3a6a777fb624b1a4c7bcb95c3eb625 (patch)
tree96da08d54bd2605c76160109382ee6d18fd7d06c /test/ruby/test_module.rb
parent7815cbd7d0699ab0b9e50998882b7981acca8e07 (diff)
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
Diffstat (limited to 'test/ruby/test_module.rb')
-rw-r--r--test/ruby/test_module.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index 84dedb431b..8afb34ae78 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -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