summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColby Swandale <me@colby.fyi>2018-12-28 22:22:14 +1100
committerColby Swandale <me@colby.fyi>2018-12-28 22:22:14 +1100
commite63e844bc7444c6a489fcde0dc7011c6c4807edd (patch)
tree16d8a3666b290d7f27b80f147c8edd419f702ffd
parent21ac802b8c54718687a8682c396fc31e5a215ebc (diff)
downloadbundler-e63e844bc7444c6a489fcde0dc7011c6c4807edd.tar.gz
make system_bundle_bin_path helper and resolve failing tests for ruby < 2.6
-rw-r--r--spec/commands/exec_spec.rb3
-rw-r--r--spec/support/helpers.rb2
-rw-r--r--spec/support/path.rb4
3 files changed, 7 insertions, 2 deletions
diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb
index fdf60cefe7..7503b9db5f 100644
--- a/spec/commands/exec_spec.rb
+++ b/spec/commands/exec_spec.rb
@@ -800,10 +800,11 @@ __FILE__: #{path.to_s.inspect}
it "overrides disable_shared_gems so bundler can be found" do
skip "bundler 1.16.x is not support with Ruby 2.6 on Travis CI" if RUBY_VERSION >= "2.6"
+ system_gems :bundler
file = bundled_app("file_that_bundle_execs.rb")
create_file(file, <<-RB)
#!#{Gem.ruby}
- puts `bundle exec echo foo`
+ puts `#{system_bundle_bin_path} 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 a6b9cfdc35..9126256f8e 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -104,7 +104,7 @@ module Spec
bundle_bin = options.delete("bundle_bin") || bindir.join("bundle")
if system_bundler = options.delete(:system_bundler)
- bundle_bin = system_gem_path.join("bin/bundler")
+ bundle_bin = system_bundle_bin_path
end
env = options.delete(:env) || {}
diff --git a/spec/support/path.rb b/spec/support/path.rb
index c28414e083..f85fbf330f 100644
--- a/spec/support/path.rb
+++ b/spec/support/path.rb
@@ -90,6 +90,10 @@ 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