aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-16 17:54:12 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-18 13:45:25 +0900
commit5a69a23afcc39a87bf808f484fa476978a9a0b4d (patch)
tree885a9599f835eb780b57c33eb4c75e7702c927bd /spec
parent0653d8c6018dc9f52856c7b38188c88669be2c83 (diff)
downloadruby-5a69a23afcc39a87bf808f484fa476978a9a0b4d.tar.gz
[bundler/bundler] 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. https://github.com/bundler/bundler/commit/a3d72a34ab
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/commands/exec_spec.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/spec/bundler/commands/exec_spec.rb b/spec/bundler/commands/exec_spec.rb
index 303dbb243a..ec75b9eb0d 100644
--- a/spec/bundler/commands/exec_spec.rb
+++ b/spec/bundler/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