summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-08-09 15:52:41 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-08-09 15:52:41 +0900
commit67153b0f17fb2f8a6942e7723845a7e1d11c0411 (patch)
tree527c52dac48928d4c8744f2d1f1d268dd3cca6d1 /test
parent39488f0baf879d474c70cface3dd056ff6912614 (diff)
parente75e2083fd6ddb35f58ac63ae2b98a5222b1854a (diff)
downloadmruby-67153b0f17fb2f8a6942e7723845a7e1d11c0411.tar.gz
mruby-67153b0f17fb2f8a6942e7723845a7e1d11c0411.zip
Merge pull request #2521 from kou/fix-class-variable-and-singleton-class-method
Fix a bug that class variable can't be referenced from class method
Diffstat (limited to 'test')
-rw-r--r--test/t/class.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/t/class.rb b/test/t/class.rb
index f49ccf494..d4ecf99d0 100644
--- a/test/t/class.rb
+++ b/test/t/class.rb
@@ -370,3 +370,16 @@ assert('clone Class') do
Foo.clone.new.func
end
+
+assert('class variable and class << self style class method') do
+ class ClassVariableTest
+ @@class_variable = "value"
+ class << self
+ def class_variable
+ @@class_variable
+ end
+ end
+ end
+
+ assert_equal("value", ClassVariableTest.class_variable)
+end