summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-03-10 10:06:49 +0900
committergit <svn-admin@ruby-lang.org>2023-03-10 05:16:52 +0000
commitf1c9f89ff89ea044c2fda11b9684309c6c31f64c (patch)
tree068098b0ac1c5bdd15c8a9ef6dfd9c318ad94841 /test
parent65f2563551faead262731083cc30593dfcbd9083 (diff)
[rubygems/rubygems] Disable side-effect of GEM_HOME configuration
https://github.com/rubygems/rubygems/commit/c43328ab03
Diffstat (limited to 'test')
-rw-r--r--test/rubygems/test_gem.rb5
-rw-r--r--test/rubygems/test_gem_gem_runner.rb5
2 files changed, 10 insertions, 0 deletions
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
index 99335ddb5b..c868ac89dd 100644
--- a/test/rubygems/test_gem.rb
+++ b/test/rubygems/test_gem.rb
@@ -1464,6 +1464,9 @@ class TestGem < Gem::TestCase
end
def test_load_user_installed_plugins
+ @orig_gem_home = ENV['GEM_HOME']
+ ENV['GEM_HOME'] = @gemhome
+
plugin_path = File.join "lib", "rubygems_plugin.rb"
Dir.chdir @tempdir do
@@ -1486,6 +1489,8 @@ class TestGem < Gem::TestCase
Gem.load_plugins
assert_equal %w[plugin], PLUGINS_LOADED
+ ensure
+ ENV['GEM_HOME'] = @orig_gem_home
end
def test_load_env_plugins
diff --git a/test/rubygems/test_gem_gem_runner.rb b/test/rubygems/test_gem_gem_runner.rb
index bc59c278d2..30b67280a9 100644
--- a/test/rubygems/test_gem_gem_runner.rb
+++ b/test/rubygems/test_gem_gem_runner.rb
@@ -3,6 +3,9 @@ require_relative "helper"
class TestGemGemRunner < Gem::TestCase
def setup
+ @orig_gem_home = ENV["GEM_HOME"]
+ ENV["GEM_HOME"] = @gemhome
+
require "rubygems/command"
@orig_args = Gem::Command.build_args
@orig_specific_extra_args = Gem::Command.specific_extra_args_hash.dup
@@ -20,6 +23,8 @@ class TestGemGemRunner < Gem::TestCase
Gem::Command.build_args = @orig_args
Gem::Command.specific_extra_args_hash = @orig_specific_extra_args
Gem::Command.extra_args = @orig_extra_args
+
+ ENV["GEM_HOME"] = @orig_gem_home
end
def test_do_configuration