summaryrefslogtreecommitdiff
path: root/spec/bundler/runtime/with_unbundled_env_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/bundler/runtime/with_unbundled_env_spec.rb')
-rw-r--r--spec/bundler/runtime/with_unbundled_env_spec.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/bundler/runtime/with_unbundled_env_spec.rb b/spec/bundler/runtime/with_unbundled_env_spec.rb
index 84b198cfb6..8c3582f7ac 100644
--- a/spec/bundler/runtime/with_unbundled_env_spec.rb
+++ b/spec/bundler/runtime/with_unbundled_env_spec.rb
@@ -2,13 +2,13 @@
RSpec.describe "Bundler.with_env helpers" do
def bundle_exec_ruby(args, options = {})
- build_bundler_context options
+ build_bundler_context options.dup
bundle "exec '#{Gem.ruby}' #{args}", options
end
def build_bundler_context(options = {})
- bundle "config set path vendor/bundle"
- gemfile "source \"#{file_uri_for(gem_repo1)}\""
+ bundle "config set path vendor/bundle", options.dup
+ gemfile "source 'https://gem.repo1'"
bundle "install", options
end
@@ -65,11 +65,11 @@ RSpec.describe "Bundler.with_env helpers" do
# Simulate bundler has not yet been loaded
ENV.replace(ENV.to_hash.delete_if {|k, _v| k.start_with?(Bundler::EnvironmentPreserver::BUNDLER_PREFIX) })
- original = ruby('puts ENV.to_a.map {|e| e.join("=") }.sort.join("\n")')
+ original = ruby('puts ENV.to_a.map {|e| e.join("=") }.sort.join("\n")', artifice: "fail")
create_file("source.rb", <<-RUBY)
puts Bundler.original_env.to_a.map {|e| e.join("=") }.sort.join("\n")
RUBY
- bundle_exec_ruby bundled_app("source.rb")
+ bundle_exec_ruby bundled_app("source.rb"), artifice: "fail"
expect(out).to eq original
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