mirror of
https://github.com/ruby/ruby.git
synced 2025-09-18 18:13:58 +02:00
support multi-run for ruby/test_basicinstructions.rb
cvar should be initialized at first.
This commit is contained in:
parent
b17bab7472
commit
501e7f4959
1 changed files with 4 additions and 1 deletions
|
@ -428,7 +428,9 @@ class TestBasicInstructions < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
class CVarA
|
class CVarA
|
||||||
|
def self.setup
|
||||||
@@cv = 'CVarA@@cv'
|
@@cv = 'CVarA@@cv'
|
||||||
|
end
|
||||||
def self.cv() @@cv end
|
def self.cv() @@cv end
|
||||||
def self.cv=(v) @@cv = v end
|
def self.cv=(v) @@cv = v end
|
||||||
class << self
|
class << self
|
||||||
|
@ -449,6 +451,7 @@ class TestBasicInstructions < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_class_variable
|
def test_class_variable
|
||||||
|
CVarA.setup
|
||||||
assert_equal 'CVarA@@cv', CVarA.cv
|
assert_equal 'CVarA@@cv', CVarA.cv
|
||||||
assert_equal 'CVarA@@cv', CVarA.cv2
|
assert_equal 'CVarA@@cv', CVarA.cv2
|
||||||
assert_equal 'CVarA@@cv', CVarA.new.cv
|
assert_equal 'CVarA@@cv', CVarA.new.cv
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue