summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-10-30 19:33:09 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-11-04 17:49:26 +0100
commit3316adaa07add862a56398566d456e87fa943386 (patch)
treef5ecaeae0846574106f9af44ae706034a0e27360
parent43c7f2ee13225cc8eb8431afbcbd87c8d1856bf8 (diff)
downloadbundler-spec_normalizations.tar.gz
Always use folder structure aware path helpersspec_normalizations
-rw-r--r--spec/commands/newgem_spec.rb2
-rw-r--r--spec/spec_helper.rb7
-rw-r--r--spec/support/artifice/vcr.rb3
-rw-r--r--spec/support/rubygems_version_manager.rb2
4 files changed, 8 insertions, 6 deletions
diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb
index 493d300eb1..708b41f623 100644
--- a/spec/commands/newgem_spec.rb
+++ b/spec/commands/newgem_spec.rb
@@ -26,7 +26,7 @@ RSpec.describe "bundle gem" do
user = bundleuser
EOF
@git_config_location = ENV["GIT_CONFIG"]
- path = "#{File.expand_path(tmp, File.dirname(__FILE__))}/test_git_config.txt"
+ path = "#{tmp}/test_git_config.txt"
File.open(path, "w") {|f| f.write(git_config_content) }
ENV["GIT_CONFIG"] = path
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 98bc21e537..ba21d22fbd 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,7 +1,9 @@
# frozen_string_literal: true
-$:.unshift File.expand_path("..", __FILE__)
-$:.unshift File.expand_path("../../lib", __FILE__)
+require_relative "support/path"
+
+$:.unshift Spec::Path.spec_dir.to_s
+$:.unshift Spec::Path.lib_dir.to_s
require "bundler/psyched_yaml"
require "bundler/vendored_fileutils"
@@ -20,7 +22,6 @@ require_relative "support/filters"
require_relative "support/helpers"
require_relative "support/indexes"
require_relative "support/matchers"
-require_relative "support/path"
require_relative "support/parallel"
require_relative "support/permissions"
require_relative "support/platforms"
diff --git a/spec/support/artifice/vcr.rb b/spec/support/artifice/vcr.rb
index 1e3809ff62..a46f8e9391 100644
--- a/spec/support/artifice/vcr.rb
+++ b/spec/support/artifice/vcr.rb
@@ -1,8 +1,9 @@
# frozen_string_literal: true
require "net/http"
+require_relative "../path"
-CASSETTE_PATH = File.expand_path("../vcr_cassettes", __FILE__)
+CASSETTE_PATH = "#{Spec::Path.spec_dir}/support/artifice/vcr_cassettes"
CASSETTE_NAME = ENV.fetch("BUNDLER_SPEC_VCR_CASSETTE_NAME") { "realworld" }
class BundlerVCRHTTP < Net::HTTP
diff --git a/spec/support/rubygems_version_manager.rb b/spec/support/rubygems_version_manager.rb
index b89d704e65..31f7cc4b08 100644
--- a/spec/support/rubygems_version_manager.rb
+++ b/spec/support/rubygems_version_manager.rb
@@ -85,7 +85,7 @@ private
def resolve_local_copy_path
return expanded_env_version if env_version_is_path?
- rubygems_path = Pathname.new("../../tmp/rubygems").expand_path(__dir__)
+ rubygems_path = root.join("tmp/rubygems")
unless rubygems_path.directory?
rubygems_path.parent.mkpath