mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
add Module#class_eval test
This commit is contained in:
@@ -31,6 +31,22 @@ assert('Module#append_features', '15.2.2.4.10') do
|
||||
Test4AppendFeatures2.const_get(:Const4AppendFeatures2) == Test4AppendFeatures2
|
||||
end
|
||||
|
||||
assert('Module#class_eval', '15.2.2.4.15') do
|
||||
class Test4ClassEval
|
||||
@a = 11
|
||||
@b = 12
|
||||
end
|
||||
Test4ClassEval.class_eval do
|
||||
def method1
|
||||
end
|
||||
end
|
||||
r = Test4ClassEval.instance_methods
|
||||
Test4ClassEval.class_eval{ @a } == 11 and
|
||||
Test4ClassEval.class_eval{ @b } == 12 and
|
||||
r.class == Array and r.include?(:method1)
|
||||
end
|
||||
|
||||
|
||||
assert('Module#class_variables', '15.2.2.4.19') do
|
||||
class Test4ClassVariables1
|
||||
@@var1 = 1
|
||||
|
||||
Reference in New Issue
Block a user