diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-08-15 18:12:34 +0200 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-08-16 08:43:48 +0200 |
commit | 8eedbecac090d528e1dff0ae7b094620571df115 (patch) | |
tree | b42f4b9fb5f5202ea4860b01218c28a464aa1deb | |
parent | 37d5dedffe875782bb8fcb16e11fad4851dde51c (diff) | |
download | bundler-8eedbecac090d528e1dff0ae7b094620571df115.tar.gz |
Extract a `gem_bin` path helper
-rw-r--r-- | spec/support/path.rb | 4 | ||||
-rw-r--r-- | spec/support/rubygems_ext.rb | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/spec/support/path.rb b/spec/support/path.rb index 302d79dc46..80616ce546 100644 --- a/spec/support/path.rb +++ b/spec/support/path.rb @@ -17,6 +17,10 @@ module Spec @bindir ||= root.join(ruby_core? ? "libexec" : "exe") end + def gem_bin + @gem_bin ||= ruby_core? ? ENV["BUNDLE_GEM"] : "#{Gem.ruby} -S gem" + end + def spec_dir @spec_dir ||= root.join(ruby_core? ? "spec/bundler" : "spec") end diff --git a/spec/support/rubygems_ext.rb b/spec/support/rubygems_ext.rb index 6ca51bee16..21916bd17d 100644 --- a/spec/support/rubygems_ext.rb +++ b/spec/support/rubygems_ext.rb @@ -81,7 +81,7 @@ module Spec no_reqs.map!(&:first) reqs.map! {|name, req| "'#{name}:#{req}'" } deps = reqs.concat(no_reqs).join(" ") - gem = Spec::Path.ruby_core? ? ENV["BUNDLE_GEM"] : "#{Gem.ruby} -S gem" + gem = Spec::Path.gem_bin cmd = "#{gem} install #{deps} --no-document --conservative" puts cmd system(cmd) || raise("Installing gems #{deps} for the tests to use failed!") |