diff options
| author | skandhas <[email protected]> | 2012-12-21 16:17:13 +0800 |
|---|---|---|
| committer | skandhas <[email protected]> | 2012-12-21 16:17:13 +0800 |
| commit | f612f32aef65e5c1f16ebf50fcf9221309251d25 (patch) | |
| tree | 4b0c7f1badda57591a6b68ff04ea419b519dcfa2 /test | |
| parent | d06512b093ebbbedb9affad263f4fd2e369166d0 (diff) | |
| download | mruby-f612f32aef65e5c1f16ebf50fcf9221309251d25.tar.gz mruby-f612f32aef65e5c1f16ebf50fcf9221309251d25.zip | |
fix mrb_mod_cv_set and add test for Module#class_variable_set
Diffstat (limited to 'test')
| -rw-r--r-- | test/t/module.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/t/module.rb b/test/t/module.rb index fbc93eb08..54d4f3015 100644 --- a/test/t/module.rb +++ b/test/t/module.rb @@ -54,6 +54,21 @@ assert('Module#class_variable_get', '15.2.2.4.17') do Test4ClassVariableGet.class_variable_get(:@@cv) == 99 end +assert('Module#class_variable_set', '15.2.2.4.18') do + class Test4ClassVariableSet + @@foo = 100 + def foo + @@foo + end + end + + Test4ClassVariableSet.class_variable_set(:@@cv, 99) + Test4ClassVariableSet.class_variable_set(:@@foo, 101) + + Test4ClassVariableSet.class_variables.include? :@@cv and + Test4ClassVariableSet.class_variable_get(:@@cv) == 99 and + Test4ClassVariableSet.new.foo == 101 +end assert('Module#class_variables', '15.2.2.4.19') do class Test4ClassVariables1 |
