diff options
author | Koichi Sasada <ko1@atdot.net> | 2020-01-28 12:01:26 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2020-01-28 15:23:51 +0900 |
commit | 501e7f4959a1193c82adc1b661a85621952121b8 (patch) | |
tree | 511940ea04e23aabfe9e2f85988fb863c29b1dfd | |
parent | b17bab7472a0491071c7da9e8b41305d3687a341 (diff) | |
download | ruby-501e7f4959a1193c82adc1b661a85621952121b8.tar.gz |
support multi-run for ruby/test_basicinstructions.rb
cvar should be initialized at first.
-rw-r--r-- | test/ruby/test_basicinstructions.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/ruby/test_basicinstructions.rb b/test/ruby/test_basicinstructions.rb index ab32ee54e2..f6b69cc1e5 100644 --- a/test/ruby/test_basicinstructions.rb +++ b/test/ruby/test_basicinstructions.rb @@ -428,7 +428,9 @@ class TestBasicInstructions < Test::Unit::TestCase end class CVarA - @@cv = 'CVarA@@cv' + def self.setup + @@cv = 'CVarA@@cv' + end def self.cv() @@cv end def self.cv=(v) @@cv = v end class << self @@ -449,6 +451,7 @@ class TestBasicInstructions < Test::Unit::TestCase end def test_class_variable + CVarA.setup assert_equal 'CVarA@@cv', CVarA.cv assert_equal 'CVarA@@cv', CVarA.cv2 assert_equal 'CVarA@@cv', CVarA.new.cv |