Get constant of parent class even if child class is defined in signleton class; fix #3575

This commit is contained in:
Kouichi Nakanishi
2017-04-06 23:31:34 +09:00
parent e5b61d34f6
commit fd0f79ca67
2 changed files with 24 additions and 1 deletions
+14
View File
@@ -410,6 +410,20 @@ assert('class variable in module and class << self style class method') do
assert_equal("value", ClassVariableInModuleTest.class_variable)
end
assert('child class/module defined in singleton class get parent constant') do
actual = module GetParentConstantTest
EXPECT = "value"
class << self
class CHILD
class << self
EXPECT
end
end
end
end
assert_equal("value", actual)
end
assert('overriding class variable with a module (#3235)') do
module ModuleWithCVar
@@class_variable = 1