summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-16 17:54:12 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-17 13:35:55 +0200
commita3d72a34aba89df3951fc629096b66b73bc56f95 (patch)
treec43e03e90a0e312656cd0bba171a07ad299d5ccb
parent789dd1864f534876a1078af22985a544716302dc (diff)
downloadbundler-a3d72a34aba89df3951fc629096b66b73bc56f95.tar.gz
Don't use system bundler on this spec
If we use system bundler, when booting the "outermost" bundler process, bundler will save the path to the system bundler in BUNDLE_BIN_PATH, and use it again when booting the "innermost" bundler process (`bundle exec echo foo`). That means that second process will use the system bundler path again. However, we have `-rsupport/hax` in RUBYOPT, so that file will load from the local copy of bundler, and that file will load `bundler/version` from the project (not from system), because -Ilib is in the LOAD_PATH. That will end up causing redefinition errors because the same constant will be loaded from two different locations. In general, this is expected behavior, normally you will wrap the process with `Bundler.with_original_env` to reset the environment. However, the easiest fix here is to not use system bundler, because it's not really necessary and thus doesn't help the readability of the spec.
-rw-r--r--spec/commands/exec_spec.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb
index 303dbb243a..ec75b9eb0d 100644
--- a/spec/commands/exec_spec.rb
+++ b/spec/commands/exec_spec.rb
@@ -837,14 +837,12 @@ __FILE__: #{path.to_s.inspect}
context "nested bundle exec" do
context "when bundle in a local path" do
before do
- system_gems :bundler
-
gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
gem "rack"
G
bundle "config set path vendor/bundler"
- bundle! :install, :system_bundler => true
+ bundle! :install
end
it "correctly shells out", :ruby_repo do
@@ -854,7 +852,7 @@ __FILE__: #{path.to_s.inspect}
puts `bundle exec echo foo`
RB
file.chmod(0o777)
- bundle! "exec #{file}", :system_bundler => true
+ bundle! "exec #{file}"
expect(out).to eq("foo")
end
end