mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 05:25:34 +02:00
[rubygems/rubygems] Disable side-effect of GEM_HOME configuration
c43328ab03
This commit is contained in:
parent
65f2563551
commit
f1c9f89ff8
2 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue