[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 коммит произвёл Hiroshi SHIBATA
Родитель d0da3a2a7f
Коммит 71b937d3d7
2 изменённых файлов: 4 добавлений и 6 удалений

Просмотреть файл

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

Просмотреть файл

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