[rubygems/rubygems] Disable side-effect of GEM_HOME configuration

c43328ab03
This commit is contained in:
Hiroshi SHIBATA 2023-03-10 10:06:49 +09:00 committed by git
parent 65f2563551
commit f1c9f89ff8
2 changed files with 10 additions and 0 deletions

View file

@ -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

View file

@ -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