diff options
author | Bundlerbot <bot@bundler.io> | 2018-10-17 11:34:13 +0000 |
---|---|---|
committer | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2018-12-11 09:30:19 +0900 |
commit | 65971eabeecbb160afdb2007364261d0f942ac28 (patch) | |
tree | e14f5d457245a019a2777a160d89947445889cbd | |
parent | af44d914ee4e872599d73fc13e86f1d2c139c49d (diff) | |
download | bundler-65971eabeecbb160afdb2007364261d0f942ac28.tar.gz |
Merge #6742
6742: Use helper method instead of hard-code path. r=colby-swandale a=hsbt
### What was the end-user problem that led to this PR?
In ruby core repository, We need to replace executable file like `ruby`, `rake`, `gem`.
### What is your fix for the problem, implemented in this PR?
This pull request makes hard-coded executable file to the helper methods.
Co-authored-by: SHIBATA Hiroshi <hsbt@ruby-lang.org>
(cherry picked from commit 3cc783b9495f85b8c3fea480d888c4f032942e89)
(cherry picked from commit 2dd5d81402bbeb17f31fc371513033753daf4a10)
-rw-r--r-- | spec/commands/newgem_spec.rb | 4 | ||||
-rw-r--r-- | spec/runtime/gem_tasks_spec.rb | 4 | ||||
-rw-r--r-- | spec/support/helpers.rb | 4 | ||||
-rw-r--r-- | spec/support/rubygems_ext.rb | 2 |
4 files changed, 9 insertions, 5 deletions
diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb index 4b5db87b00..598d68ec3a 100644 --- a/spec/commands/newgem_spec.rb +++ b/spec/commands/newgem_spec.rb @@ -327,7 +327,7 @@ RSpec.describe "bundle gem" do end Dir.chdir(bundled_app(gem_name)) do - sys_exec("rake") + sys_exec(rake) expect(out).to include("SUCCESS") end end @@ -612,7 +612,7 @@ RSpec.describe "bundle gem" do end Dir.chdir(bundled_app(gem_name)) do - sys_exec("rake") + sys_exec(rake) expect(out).to include("SUCCESS") end end diff --git a/spec/runtime/gem_tasks_spec.rb b/spec/runtime/gem_tasks_spec.rb index 5fc87a6d46..1cf808f35b 100644 --- a/spec/runtime/gem_tasks_spec.rb +++ b/spec/runtime/gem_tasks_spec.rb @@ -19,7 +19,7 @@ RSpec.describe "require 'bundler/gem_tasks'" do it "includes the relevant tasks" do with_gem_path_as(Spec::Path.base_system_gems.to_s) do - sys_exec "ruby -S rake -T" + sys_exec "#{rake} -T" end expect(err).to eq("") @@ -37,7 +37,7 @@ RSpec.describe "require 'bundler/gem_tasks'" do it "adds 'pkg' to rake/clean's CLOBBER" do with_gem_path_as(Spec::Path.base_system_gems.to_s) do - sys_exec! %('#{Gem.ruby}' -S rake -e 'load "Rakefile"; puts CLOBBER.inspect') + sys_exec! %(#{rake} -e 'load "Rakefile"; puts CLOBBER.inspect') end expect(last_command.stdout).to eq '["pkg"]' end diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index d14ac20cae..87d6152522 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -216,6 +216,10 @@ module Spec end bang :gem_command + def rake + "#{Gem.ruby} -S #{ENV["GEM_PATH"]}/bin/rake" + end + def sys_exec(cmd) command_execution = CommandExecution.new(cmd.to_s, Dir.pwd) diff --git a/spec/support/rubygems_ext.rb b/spec/support/rubygems_ext.rb index 806933fe2f..c18f7650fc 100644 --- a/spec/support/rubygems_ext.rb +++ b/spec/support/rubygems_ext.rb @@ -33,7 +33,7 @@ module Spec ENV["BUNDLE_PATH"] = nil ENV["GEM_HOME"] = ENV["GEM_PATH"] = Path.base_system_gems.to_s - ENV["PATH"] = ["#{Path.root}/exe", "#{Path.system_gem_path}/bin", ENV["PATH"]].join(File::PATH_SEPARATOR) + ENV["PATH"] = [Path.bindir, "#{Path.system_gem_path}/bin", ENV["PATH"]].join(File::PATH_SEPARATOR) manifest = DEPS.to_a.sort_by(&:first).map {|k, v| "#{k} => #{v}\n" } manifest_path = "#{Path.base_system_gems}/manifest.txt" |