diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-30 12:00:56 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-30 12:00:56 +0000 |
commit | 0e15934d7fe0244573526f5ff3c6232bb3de2662 (patch) | |
tree | 73277a458e007127c05bad2ae7dfcfbf85458b2f /test | |
parent | e652ecfac71f0daf752e529dca6a9a0a444e26b3 (diff) | |
download | ruby-0e15934d7fe0244573526f5ff3c6232bb3de2662.tar.gz |
variable.c: fix r36574
* variable.c (find_class_path): no retry when preferred is given.
* variable.c (classname): if classid is set try it to find full
qualified class path, and then try arbitrary class path. try
tmp_classpath at last even if enclosing namespace is anonymous.
fix r36574. [ruby-core:42865][Bug #6078]
* variable.c (rb_set_class_path_string, rb_set_class_path): set
tmp_classpath instead of classpath if the name is not permanent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_module.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 2051617aad..fc594ec128 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -372,12 +372,16 @@ class TestModule < Test::Unit::TestCase assert_equal([:N], m.constants) m.module_eval("module O end") assert_equal([:N, :O], m.constants) + m.module_eval("class C end") + assert_equal([:N, :O, :C], m.constants) assert_nil(m::N.name) - assert_match(/\A(?:#<Module:.*>::)?O\z/, m::O.name) + assert_match(/\A#<Module:.*>::O\z/, m::O.name) + assert_match(/\A#<Class:.*>::O\z/, m::C.name) self.class.const_set(:M, m) prefix = self.class.name + "::M::" assert_equal(prefix+"N", m.const_get(:N).name) assert_equal(prefix+"O", m.const_get(:O).name) + assert_equal(prefix+"C", m.const_get(:C).name) end def test_private_class_method |