[rubygems/rubygems] Don't upcase Windows ENV when backing it up
I apparently did that to fix some issue with case insensitivity but I didn't add a spec, and I think not upcasing should not cause issues. https://github.com/rubygems/rubygems/commit/1b6f23275a
This commit is contained in:
parent
2871376510
commit
5d2fb5d76b
@ -19,14 +19,7 @@ module Bundler
|
||||
BUNDLER_PREFIX = "BUNDLER_ORIG_"
|
||||
|
||||
def self.from_env
|
||||
new(env_to_hash(ENV), BUNDLER_KEYS)
|
||||
end
|
||||
|
||||
def self.env_to_hash(env)
|
||||
to_hash = env.to_hash
|
||||
return to_hash unless Gem.win_platform?
|
||||
|
||||
to_hash.each_with_object({}) {|(k,v), a| a[k.upcase] = v }
|
||||
new(ENV.to_hash, BUNDLER_KEYS)
|
||||
end
|
||||
|
||||
# @param env [Hash]
|
||||
|
@ -638,4 +638,22 @@ RSpec.describe "bundler/inline#gemfile" do
|
||||
|
||||
expect(out).to include("Installing timeout 999")
|
||||
end
|
||||
|
||||
it "does not upcase ENV" do
|
||||
script <<-RUBY
|
||||
require 'bundler/inline'
|
||||
|
||||
ENV['Test_Variable'] = 'value string'
|
||||
puts("before: \#{ENV.each_key.select { |key| key.match?(/test_variable/i) }}")
|
||||
|
||||
gemfile do
|
||||
source "#{file_uri_for(gem_repo1)}"
|
||||
end
|
||||
|
||||
puts("after: \#{ENV.each_key.select { |key| key.match?(/test_variable/i) }}")
|
||||
RUBY
|
||||
|
||||
expect(out).to include("before: [\"Test_Variable\"]")
|
||||
expect(out).to include("after: [\"Test_Variable\"]")
|
||||
end
|
||||
end
|
||||
|
@ -139,7 +139,7 @@ RSpec.describe "Bundler.with_env helpers" do
|
||||
describe "Bundler.with_original_env" do
|
||||
it "should set ENV to original_env in the block" do
|
||||
expected = Bundler.original_env
|
||||
actual = Bundler.with_original_env { Bundler::EnvironmentPreserver.env_to_hash(ENV) }
|
||||
actual = Bundler.with_original_env { ENV.to_hash }
|
||||
expect(actual).to eq(expected)
|
||||
end
|
||||
|
||||
@ -157,7 +157,7 @@ RSpec.describe "Bundler.with_env helpers" do
|
||||
expected = Bundler.unbundled_env
|
||||
|
||||
actual = Bundler.ui.silence do
|
||||
Bundler.with_clean_env { Bundler::EnvironmentPreserver.env_to_hash(ENV) }
|
||||
Bundler.with_clean_env { ENV.to_hash }
|
||||
end
|
||||
|
||||
expect(actual).to eq(expected)
|
||||
@ -175,7 +175,7 @@ RSpec.describe "Bundler.with_env helpers" do
|
||||
describe "Bundler.with_unbundled_env" do
|
||||
it "should set ENV to unbundled_env in the block" do
|
||||
expected = Bundler.unbundled_env
|
||||
actual = Bundler.with_unbundled_env { Bundler::EnvironmentPreserver.env_to_hash(ENV) }
|
||||
actual = Bundler.with_unbundled_env { ENV.to_hash }
|
||||
expect(actual).to eq(expected)
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user