diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-14 05:58:51 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-14 05:58:51 +0000 |
commit | 86d4408ce9c0463b9c77623cba5d58d9e9e9d289 (patch) | |
tree | 5f276c672aa8b49559aeee572a8743fdd1cdbd04 /test | |
parent | 90d94de3b00f506dfb769501a5f11dbf2186d434 (diff) |
merge revision(s) 44628: [Backport #9413]
* eval.c (rb_mod_s_constants): return its own constants for other
than Module itself. [ruby-core:59763] [Bug #9413]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@44939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_module.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 6673852d9c..e72a6ab8c9 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -669,6 +669,19 @@ class TestModule < Test::Unit::TestCase m.instance_eval { remove_const(:Foo) } end + class Bug9413 + class << self + Foo = :foo + end + end + + def test_singleton_constants + bug9413 = '[ruby-core:59763] [Bug #9413]' + c = Bug9413.singleton_class + assert_include(c.constants(true), :Foo, bug9413) + assert_include(c.constants(false), :Foo, bug9413) + end + def test_frozen_class m = Module.new m.freeze |