1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] Normalize setting GEM_PATH

https://github.com/rubygems/rubygems/commit/4188ebd568
This commit is contained in:
David Rodríguez 2021-08-21 16:52:48 +02:00 committed by Hiroshi SHIBATA
parent d0da3a2a7f
commit 71b937d3d7
Notes: git 2021-08-31 19:07:01 +09:00
2 changed files with 4 additions and 6 deletions

View file

@ -661,12 +661,12 @@ EOF
configure_gem_home
end
def configure_gem_path(env = ENV)
def configure_gem_path
unless use_system_gems?
# this needs to be empty string to cause
# PathSupport.split_gem_path to only load up the
# Bundler --path setting as the GEM_PATH.
env["GEM_PATH"] = ""
Bundler::SharedHelpers.set_env "GEM_PATH", ""
end
end

View file

@ -176,11 +176,9 @@ RSpec.describe Bundler do
describe "configuration" do
context "disable_shared_gems" do
it "should unset GEM_PATH with empty string" do
env = {}
expect(Bundler).to receive(:use_system_gems?).and_return(false)
Bundler.send(:configure_gem_path, env)
expect(env.keys).to include("GEM_PATH")
expect(env["GEM_PATH"]).to eq ""
Bundler.send(:configure_gem_path)
expect(ENV["GEM_PATH"]).to eq ""
end
end
end