summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSHIBATA Hiroshi <hsbt@ruby-lang.org>2017-09-07 09:36:06 +0900
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2017-09-07 09:36:06 +0900
commit2c501b2bd08afa1a6904c18eaf281d9d49d93e66 (patch)
treebbd107640394262d713fd54e6ffcd4187325809f
parente63c6f66f9afddf58c282764ead68143cf83d1e1 (diff)
downloadbundler-2c501b2bd08afa1a6904c18eaf281d9d49d93e66.tar.gz
Use Pathname#join instead of string interpolation
-rw-r--r--spec/commands/exec_spec.rb4
-rw-r--r--spec/commands/newgem_spec.rb2
-rw-r--r--spec/runtime/with_clean_env_spec.rb2
-rw-r--r--spec/support/artifice/endpoint.rb2
-rw-r--r--spec/support/helpers.rb8
5 files changed, 9 insertions, 9 deletions
diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb
index 20b07e064b..049ec830fb 100644
--- a/spec/commands/exec_spec.rb
+++ b/spec/commands/exec_spec.rb
@@ -61,7 +61,7 @@ RSpec.describe "bundle exec" do
it "handles --keep-file-descriptors" do
require "tempfile"
- bundle_bin = File.expand_path("#{Spec::Path.bindir}/bundle", __FILE__)
+ bundle_bin = File.expand_path(Spec::Path.bindir.join("bundle"), __FILE__)
command = Tempfile.new("io-test")
command.sync = true
@@ -474,7 +474,7 @@ RSpec.describe "bundle exec" do
Bundler.rubygems.extend(Monkey)
G
bundle "install --deployment"
- bundle "exec ruby -e '`#{Spec::Path.bindir}/bundler -v`; puts $?.success?'"
+ bundle "exec ruby -e '`#{Spec::Path.bindir.join("bundler")} -v`; puts $?.success?'"
expect(out).to match("true")
end
end
diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb
index f9420e46dd..d14aee4136 100644
--- a/spec/commands/newgem_spec.rb
+++ b/spec/commands/newgem_spec.rb
@@ -170,7 +170,7 @@ RSpec.describe "bundle gem" do
# This spec cannot have `git` available in the test env
before do
- bundle_bin = File.expand_path("#{Spec::Path.bindir}/bundle", __FILE__)
+ bundle_bin = File.expand_path(Spec::Path.bindir.join("bundle"), __FILE__)
load_paths = [lib, spec]
load_path_str = "-I#{load_paths.join(File::PATH_SEPARATOR)}"
diff --git a/spec/runtime/with_clean_env_spec.rb b/spec/runtime/with_clean_env_spec.rb
index 74694aa9ef..f471118ba9 100644
--- a/spec/runtime/with_clean_env_spec.rb
+++ b/spec/runtime/with_clean_env_spec.rb
@@ -79,7 +79,7 @@ RSpec.describe "Bundler.with_env helpers" do
it "should clean up RUBYLIB" do
code = "print Bundler.clean_env['RUBYLIB']"
- ENV["RUBYLIB"] = File.expand_path("#{Spec::Path.root}/lib", __FILE__) + File::PATH_SEPARATOR + "/foo"
+ ENV["RUBYLIB"] = File.expand_path(Spec::Path.root.join("lib"), __FILE__) + File::PATH_SEPARATOR + "/foo"
result = bundle("exec '#{Gem.ruby}' -e #{code.inspect}")
expect(result).to eq("/foo")
end
diff --git a/spec/support/artifice/endpoint.rb b/spec/support/artifice/endpoint.rb
index 21c44ba6e0..210f364a12 100644
--- a/spec/support/artifice/endpoint.rb
+++ b/spec/support/artifice/endpoint.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
require File.expand_path("../../path.rb", __FILE__)
-require File.expand_path("#{Spec::Path.root}/lib/bundler/deprecate", __FILE__)
+require File.expand_path(Spec::Path.root.join("lib/bundler/deprecate"), __FILE__)
include Spec::Path
$LOAD_PATH.unshift(*Dir[Spec::Path.base_system_gems.join("gems/{artifice,rack,tilt,sinatra}-*/lib")].map(&:to_s))
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index 3160ae88e4..044c319e70 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -88,7 +88,7 @@ module Spec
end
def lib
- File.expand_path("#{Spec::Path.root}/lib", __FILE__)
+ File.expand_path(Spec::Path.root.join("lib"), __FILE__)
end
def spec
@@ -102,7 +102,7 @@ module Spec
no_color = options.delete("no-color") { cmd.to_s !~ /\A(e|ex|exe|exec|conf|confi|config)(\s|\z)/ }
options["no-color"] = true if no_color
- bundle_bin = options.delete("bundle_bin") || File.expand_path("#{Spec::Path.bindir}/bundle", __FILE__)
+ bundle_bin = options.delete("bundle_bin") || File.expand_path(Spec::Path.bindir.join("bundle"), __FILE__)
if system_bundler = options.delete(:system_bundler)
bundle_bin = "-S bundle"
@@ -171,12 +171,12 @@ module Spec
end
def bundler(cmd, options = {})
- options["bundle_bin"] = File.expand_path("#{Spec::Path.bindir}/bundler", __FILE__)
+ options["bundle_bin"] = File.expand_path(Spec::Path.bindir.join("bundler"), __FILE__)
bundle(cmd, options)
end
def bundle_ruby(options = {})
- options["bundle_bin"] = File.expand_path("#{Spec::Path.bindir}/bundle_ruby", __FILE__)
+ options["bundle_bin"] = File.expand_path(Spec::Path.bindir.join("bundle_ruby"), __FILE__)
bundle("", options)
end