From 507e00e86f73787560ddedb7e7b875a6d5ed37a4 Mon Sep 17 00:00:00 2001 From: Kouichi Nakanishi Date: Fri, 31 Mar 2017 12:55:43 +0900 Subject: Modify to get constant of parent module in singleton class; fix #3568 --- test/t/module.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/t') 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 -- cgit v1.2.3