diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-08-25 14:24:44 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-08-26 15:04:15 -0500 |
commit | a05ccee50645053134aad71ddfc264fe566efb13 (patch) | |
tree | b15ddcaa041e8aa5b3fda768ba9840d7cb268426 | |
parent | 0d26ec5cb9b02576da4950e1fc99088efe25c17f (diff) | |
download | bundler-a05ccee50645053134aad71ddfc264fe566efb13.tar.gz |
Use Gem.ruby for bundle exec ruby in specs
-rw-r--r-- | spec/runtime/with_clean_env_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/runtime/with_clean_env_spec.rb b/spec/runtime/with_clean_env_spec.rb index e5584db2aa..546b184383 100644 --- a/spec/runtime/with_clean_env_spec.rb +++ b/spec/runtime/with_clean_env_spec.rb @@ -12,7 +12,7 @@ describe "Bundler.with_env helpers" do code = "print Bundler.original_env['PATH']" path = `getconf PATH`.strip + "#{File::PATH_SEPARATOR}/foo" with_path_as(path) do - result = bundle("exec ruby -e #{code.dump}") + result = bundle("exec #{Gem.ruby.dump} -e #{code.dump}") expect(result).to eq(path) end end @@ -21,24 +21,24 @@ describe "Bundler.with_env helpers" do code = "print Bundler.original_env['GEM_PATH']" gem_path = ENV["GEM_PATH"] + ":/foo" with_gem_path_as(gem_path) do - result = bundle("exec ruby -e #{code.inspect}") + result = bundle("exec #{Gem.ruby.dump} -e #{code.inspect}") expect(result).to eq(gem_path) end end it "works with nested bundle exec invocations" do - create_file("exe.rb", <<-'RB') + create_file("exe.rb", format(<<-'RB', Gem.ruby.dump)) count = ARGV.first.to_i exit if count < 0 STDERR.puts "#{count} #{ENV["PATH"].end_with?(":/foo")}" if count == 2 ENV["PATH"] = "#{ENV["PATH"]}:/foo" end - exec("ruby", __FILE__, (count - 1).to_s) + exec(%s, __FILE__, (count - 1).to_s) RB path = `getconf PATH`.strip + File::PATH_SEPARATOR + File.dirname(Gem.ruby) with_path_as(path) do - bundle!("exec ruby #{bundled_app("exe.rb")} 2", :expect_err => true) + bundle!("exec #{Gem.ruby.dump} #{bundled_app("exe.rb")} 2", :expect_err => true) end expect(err).to eq <<-EOS.strip 2 false |