mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Get constant of parent class even if child class is defined in signleton class; fix #3575
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user