From 90427875085f480c4c8e02d4252804cac29d7aaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Wed, 8 Apr 2020 21:10:33 +0200 Subject: [PATCH] [rubygems/rubygems] Remove unnecessary `@@ruby` variable https://github.com/rubygems/rubygems/commit/5f20647ec1 --- lib/rubygems/test_case.rb | 3 +-- test/rubygems/test_gem_ext_rake_builder.rb | 4 ++-- test/rubygems/test_require.rb | 8 ++++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb index f1f6b853a4..b4d8db317c 100644 --- a/lib/rubygems/test_case.rb +++ b/lib/rubygems/test_case.rb @@ -1220,7 +1220,7 @@ Also, a list: def build_rake_in(good=true) gem_ruby = Gem.ruby - Gem.ruby = @@ruby + Gem.ruby = self.class.rubybin env_rake = ENV["rake"] rake = (good ? @@good_rake : @@bad_rake) ENV["rake"] = rake @@ -1289,7 +1289,6 @@ Also, a list: end - @@ruby = rubybin @@good_rake = "#{rubybin} #{escape_path(TEST_PATH, 'good_rake.rb')}" @@bad_rake = "#{rubybin} #{escape_path(TEST_PATH, 'bad_rake.rb')}" diff --git a/test/rubygems/test_gem_ext_rake_builder.rb b/test/rubygems/test_gem_ext_rake_builder.rb index 1b5993c705..9d789174ce 100644 --- a/test/rubygems/test_gem_ext_rake_builder.rb +++ b/test/rubygems/test_gem_ext_rake_builder.rb @@ -26,7 +26,7 @@ class TestGemExtRakeBuilder < Gem::TestCase output = output.join "\n" refute_match %r{^rake failed:}, output - assert_match %r{^#{Regexp.escape @@ruby} mkrf_conf\.rb}, output + assert_match %r{^#{Regexp.escape Gem.ruby} mkrf_conf\.rb}, output assert_match %r{^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path}}, output end end @@ -47,7 +47,7 @@ class TestGemExtRakeBuilder < Gem::TestCase output = output.join "\n" refute_match %r{^rake failed:}, output - assert_match %r{^#{Regexp.escape @@ruby} mkrf_conf\.rb}, output + assert_match %r{^#{Regexp.escape Gem.ruby} mkrf_conf\.rb}, output assert_match %r{^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path}}, output end end diff --git a/test/rubygems/test_require.rb b/test/rubygems/test_require.rb index 7b071ba88f..e6c69c8b87 100644 --- a/test/rubygems/test_require.rb +++ b/test/rubygems/test_require.rb @@ -523,11 +523,11 @@ class TestGemRequire < Gem::TestCase File.write(dir + "/sub.rb", "#{prefix}warn 'uplevel', 'test', uplevel: 1\n") File.write(dir + "/main.rb", "require 'sub'\n") _, err = capture_subprocess_io do - system(@@ruby, "-w", "--disable=gems", "-I", lib, "-C", dir, "-I.", "main.rb") + system(Gem.ruby, "-w", "--disable=gems", "-I", lib, "-C", dir, "-I.", "main.rb") end assert_match(/main\.rb:1: warning: uplevel\ntest\n$/, err) _, err = capture_subprocess_io do - system(@@ruby, "-w", "--enable=gems", "-I", lib, "-C", dir, "-I.", "main.rb") + system(Gem.ruby, "-w", "--enable=gems", "-I", lib, "-C", dir, "-I.", "main.rb") end assert_match(/main\.rb:1: warning: uplevel\ntest\n$/, err) end @@ -538,11 +538,11 @@ class TestGemRequire < Gem::TestCase Dir.mktmpdir("warn_test") do |dir| File.write(dir + "/main.rb", "#{prefix}warn({x:1}, {y:2}, [])\n") _, err = capture_subprocess_io do - system(@@ruby, "-w", "--disable=gems", "-I", lib, "-C", dir, "main.rb") + system(Gem.ruby, "-w", "--disable=gems", "-I", lib, "-C", dir, "main.rb") end assert_match(/{:x=>1}\n{:y=>2}\n$/, err) _, err = capture_subprocess_io do - system(@@ruby, "-w", "--enable=gems", "-I", lib, "-C", dir, "main.rb") + system(Gem.ruby, "-w", "--enable=gems", "-I", lib, "-C", dir, "main.rb") end assert_match(/{:x=>1}\n{:y=>2}\n$/, err) end