aboutsummaryrefslogtreecommitdiffstats
path: root/spec/bundler/support
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-04 13:10:58 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-04 13:10:58 +0000
commite97741e12a22d78825a3a9dfcb7382adb0e27855 (patch)
tree5344cb31a89df6fd5fbae92740d4229d655eee8f /spec/bundler/support
parent4bbbbb6a3f5bd242f740041a644311f97c4a0052 (diff)
downloadruby-e97741e12a22d78825a3a9dfcb7382adb0e27855.tar.gz
Merge Bundler 2.0.1 from upstream.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/bundler/support')
-rw-r--r--spec/bundler/support/helpers.rb6
-rw-r--r--spec/bundler/support/path.rb6
-rw-r--r--spec/bundler/support/platforms.rb2
3 files changed, 9 insertions, 5 deletions
diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb
index b027e7a922..43bf6af229 100644
--- a/spec/bundler/support/helpers.rb
+++ b/spec/bundler/support/helpers.rb
@@ -53,7 +53,7 @@ module Spec
end
def bundle_update_requires_all?
- Bundler::VERSION.start_with?("1.") ? nil : true
+ Bundler::VERSION.start_with?("2.") ? nil : true
end
def in_app_root(&blk)
@@ -104,7 +104,7 @@ module Spec
bundle_bin = options.delete("bundle_bin") || bindir.join("bundle")
if system_bundler = options.delete(:system_bundler)
- bundle_bin = "-S bundle"
+ bundle_bin = system_bundle_bin_path
end
env = options.delete(:env) || {}
@@ -152,7 +152,7 @@ module Spec
bang :bundle
def forgotten_command_line_options(options)
- remembered = Bundler::VERSION.split(".", 2).first == "1"
+ remembered = Bundler.bundler_major_version < 3
options = options.map do |k, v|
k = Array(k)[remembered ? 0 : -1]
v = '""' if v && v.to_s.empty?
diff --git a/spec/bundler/support/path.rb b/spec/bundler/support/path.rb
index 76fa89d3cc..38f7145dc7 100644
--- a/spec/bundler/support/path.rb
+++ b/spec/bundler/support/path.rb
@@ -29,7 +29,7 @@ module Spec
end
def default_bundle_path(*path)
- if Bundler::VERSION.split(".").first.to_i < 2
+ if Bundler::VERSION.split(".").first.to_i < 3
system_gem_path(*path)
else
bundled_app(*[".bundle", ENV.fetch("BUNDLER_SPEC_RUBY_ENGINE", Gem.ruby_engine), Gem::ConfigMap[:ruby_version], *path].compact)
@@ -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
diff --git a/spec/bundler/support/platforms.rb b/spec/bundler/support/platforms.rb
index 39040a61bd..950311d20e 100644
--- a/spec/bundler/support/platforms.rb
+++ b/spec/bundler/support/platforms.rb
@@ -106,7 +106,7 @@ module Spec
end
def local_platforms
- if Bundler::VERSION.split(".").first.to_i > 1
+ if Bundler::VERSION.split(".").first.to_i > 2
[local, specific_local_platform]
else
[local]