diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-12-01 18:41:23 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2016-12-01 18:41:23 +0900 |
| commit | 4d807fc619e7feccd2bc079ef76a9e817e36fa59 (patch) | |
| tree | d8f939ff77ceaa32cba522885530ef8fd22daa8e /test/t/class.rb | |
| parent | ab4ab7c8a0e5226e4a76f7c37bdb79d2c92c004f (diff) | |
| parent | 3f83ec64a82410cdc16863f8242eaea30dec026f (diff) | |
| download | mruby-4d807fc619e7feccd2bc079ef76a9e817e36fa59.tar.gz mruby-4d807fc619e7feccd2bc079ef76a9e817e36fa59.zip | |
Merge pull request #3313 from yhara/add-test
Add test for recently fixed bugs
Diffstat (limited to 'test/t/class.rb')
| -rw-r--r-- | test/t/class.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/t/class.rb b/test/t/class.rb index 597999d3e..605b7ec40 100644 --- a/test/t/class.rb +++ b/test/t/class.rb @@ -397,6 +397,18 @@ assert('class variable in module and class << self style class method') do assert_equal("value", ClassVariableInModuleTest.class_variable) end +assert('overriding class variable with a module (#3235)') do + module ModuleWithCVar + @@class_variable = 1 + end + class CVarOverrideTest + @@class_variable = 2 + include ModuleWithCVar + + assert_equal(1, @@class_variable) + end +end + assert('class with non-class/module outer raises TypeError') do assert_raise(TypeError) { class 0::C1; end } assert_raise(TypeError) { class []::C2; end } |
