summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-03-31 16:39:21 +0900
committerGitHub <[email protected]>2017-03-31 16:39:21 +0900
commit9eb2ed08794951d7614d5a9ed8518b2aa370d8b9 (patch)
tree12d4eec0f3811d726f007bc956ed9b36e0559300 /test
parent39ca4ef3bcdfec6047647e697f94cb84f2251175 (diff)
parent507e00e86f73787560ddedb7e7b875a6d5ed37a4 (diff)
downloadmruby-9eb2ed08794951d7614d5a9ed8518b2aa370d8b9.tar.gz
mruby-9eb2ed08794951d7614d5a9ed8518b2aa370d8b9.zip
Merge pull request #3571 from keizo042/fix_get_constant_of_module_from_sigleton
Modify to get constant of parent module in singleton class; fix #3568
Diffstat (limited to 'test')
-rw-r--r--test/t/module.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/t/module.rb b/test/t/module.rb
index 6b0632414..cfdca8503 100644
--- a/test/t/module.rb
+++ b/test/t/module.rb
@@ -849,3 +849,14 @@ assert('module with non-class/module outer raises TypeError') do
assert_raise(TypeError) { module 0::M1 end }
assert_raise(TypeError) { module []::M2 end }
end
+
+assert('get constant of parent module in singleton class; issue #3568') do
+ actual = module GetConstantInSingletonTest
+ EXPECTED = "value"
+ class << self
+ EXPECTED
+ end
+ end
+
+ assert_equal("value", actual)
+end