diff options
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 |