summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-16 16:32:08 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-16 16:32:08 +0000
commit37e3fd88020a7259ddc027b22bbad0e91c67ed65 (patch)
tree833a7a2d505529b9cda34e70651b68c75e800c6f /test
parentbdcadb8c440f16e132d34addfa83fb4d956cb48d (diff)
merge revision(s) r44628: [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_2_0_0@45010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_module.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index 91fddabcd0..4bc725d2b5 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -777,6 +777,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