ruby-changes:59826
From: Koichi <ko1@a...>
Date: Tue, 28 Jan 2020 15:24:30 +0900 (JST)
Subject: [ruby-changes:59826] 501e7f4959 (master): support multi-run for ruby/test_basicinstructions.rb
https://git.ruby-lang.org/ruby.git/commit/?id=501e7f4959 From 501e7f4959a1193c82adc1b661a85621952121b8 Mon Sep 17 00:00:00 2001 From: Koichi Sasada <ko1@a...> Date: Tue, 28 Jan 2020 12:01:26 +0900 Subject: support multi-run for ruby/test_basicinstructions.rb cvar should be initialized at first. diff --git a/test/ruby/test_basicinstructions.rb b/test/ruby/test_basicinstructions.rb index ab32ee5..f6b69cc 100644 --- a/test/ruby/test_basicinstructions.rb +++ b/test/ruby/test_basicinstructions.rb @@ -428,7 +428,9 @@ class TestBasicInstructions < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_basicinstructions.rb#L428 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_basicinstructions.rb#L451 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 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/