diff options
| author | Kouichi Nakanishi <[email protected]> | 2017-04-06 23:31:34 +0900 |
|---|---|---|
| committer | Kouichi Nakanishi <[email protected]> | 2017-04-06 23:31:34 +0900 |
| commit | fd0f79ca677759251e011cbe3f7fbbe88db57b62 (patch) | |
| tree | 8da0d34869be64e1080f6ed67ea384bf9037f14a /test/t | |
| parent | e5b61d34f65cabfbe88f3f1709a1f9cff86585de (diff) | |
| download | mruby-fd0f79ca677759251e011cbe3f7fbbe88db57b62.tar.gz mruby-fd0f79ca677759251e011cbe3f7fbbe88db57b62.zip | |
Get constant of parent class even if child class is defined in signleton class; fix #3575
Diffstat (limited to 'test/t')
| -rw-r--r-- | test/t/class.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/t/class.rb b/test/t/class.rb index 54fadc0ca..eb077fce6 100644 --- a/test/t/class.rb +++ b/test/t/class.rb @@ -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 |
