summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-08-08 13:00:46 +0000
committerBundlerbot <bot@bundler.io>2019-08-08 13:00:46 +0000
commitb0a15e19ecd318a044f928521eb4b0e44737f847 (patch)
tree095413fe0247afab99179572c4f702723874dffd
parentf0aa03045fdaed42df632806dd906bac982e952a (diff)
parentb29a40820f245a3adefd1bdac1b71065c789f0c9 (diff)
downloadbundler-b0a15e19ecd318a044f928521eb4b0e44737f847.tar.gz
Merge #7283
7283: Fix spec working by chance r=deivid-rodriguez a=deivid-rodriguez ### What was the end-user problem that led to this PR? The problem was that this particular spec is like a nightmare that keeps on failing whenever we make changes to bundler, and we keep adding workarounds to it. ### What was your diagnosis of the problem? My diagnosis was that I should investigate closer what's going on with this spec, and fix it in a better way. ### What is your fix for the problem, implemented in this PR? My fix is to fix several issues with the spec, and to essentially revert it back to the way it looked before https://github.com/bundler/bundler/commit/e63e844bc7444c6a489fcde0dc7011c6c4807edd. See each commit for more details. ### Why did you choose this fix out of the possible options? I chose this fix because it should make it less painful to keep CI green as we make changes to bundler. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
-rw-r--r--spec/commands/exec_spec.rb14
-rw-r--r--spec/support/helpers.rb2
-rw-r--r--spec/support/path.rb4
3 files changed, 8 insertions, 12 deletions
diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb
index 752d213994..8ad5a3c125 100644
--- a/spec/commands/exec_spec.rb
+++ b/spec/commands/exec_spec.rb
@@ -840,23 +840,23 @@ __FILE__: #{path.to_s.inspect}
end
context "nested bundle exec" do
- let(:system_gems_to_install) { super() << :bundler }
-
- context "with shared gems disabled" 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 :install, :system_bundler => true, :path => "vendor/bundler"
+ bundle "config path vendor/bundler"
+ bundle! :install, :system_bundler => true
end
- it "overrides disable_shared_gems so bundler can be found", :ruby_repo do
- system_gems :bundler
+ it "correctly shells out", :ruby_repo do
file = bundled_app("file_that_bundle_execs.rb")
create_file(file, <<-RB)
#!#{Gem.ruby}
- puts `#{system_bundle_bin_path} exec echo foo`
+ puts `bundle exec echo foo`
RB
file.chmod(0o777)
bundle! "exec #{file}", :system_bundler => true
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index 2445b566aa..02ec3c790b 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -110,7 +110,7 @@ module Spec
bundle_bin = options.delete("bundle_bin") || bindir.join("bundle")
if system_bundler = options.delete(:system_bundler)
- bundle_bin = system_bundle_bin_path
+ bundle_bin = system_gem_path.join("bin/bundler")
end
env = options.delete(:env) || {}
diff --git a/spec/support/path.rb b/spec/support/path.rb
index aa06a3f047..b722ec498b 100644
--- a/spec/support/path.rb
+++ b/spec/support/path.rb
@@ -100,10 +100,6 @@ module Spec
tmp("gems/system", *path)
end
- def system_bundle_bin_path
- system_gem_path("bin/bundle")
- end
-
def lib_path(*args)
tmp("libs", *args)
end