summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2018-09-09 14:48:46 -0300
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2018-09-17 20:34:44 -0300
commit6590fd50f71a0e4e0e3d1204299eb0d6d7768ca6 (patch)
treeb264440d0acd8e55457bc406c8a4516534f98497
parent75ac1fe72ae495a04f44a3701140c4e28eafefc1 (diff)
downloadbundler-fix_local_spec_failure.tar.gz
Friendlier solution for a problematic specfix_local_spec_failure
-rw-r--r--spec/runtime/setup_spec.rb6
-rw-r--r--spec/spec_helper.rb12
2 files changed, 5 insertions, 13 deletions
diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb
index 88f4807e35..d398a6ae8a 100644
--- a/spec/runtime/setup_spec.rb
+++ b/spec/runtime/setup_spec.rb
@@ -884,7 +884,11 @@ end
it "should successfully require 'bundler/setup'" do
install_gemfile ""
- ruby <<-R, :env => { "GEM_PATH" => symlinked_gem_home }, :no_lib => true
+ ruby <<-'R', :env => { "GEM_PATH" => symlinked_gem_home }, :no_lib => true
+ # Remove any bundler that's not the current bundler from $LOAD_PATH
+ $LOAD_PATH.each do |path|
+ $LOAD_PATH.delete(path) if File.exist?("#{path}/bundler.rb")
+ end
puts (require 'bundler/setup')
R
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 56094b72f5..228b9e5aa3 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -28,18 +28,6 @@ require "bundler/vendored_fileutils"
require "uri"
require "digest"
-# Delete the default copy of Bundler that RVM installs for us when running in CI
-require "fileutils"
-if ENV.select {|k, _v| k =~ /TRAVIS/ }.any? && Gem::Version.new(Gem::VERSION) > Gem::Version.new("2.0")
- Dir.glob(File.join(Gem::Specification.default_specifications_dir, "bundler*.gemspec")).each do |file|
- FileUtils.rm_rf(file)
- end
-
- Dir.glob(File.join(RbConfig::CONFIG["sitelibdir"], "bundler*")).each do |file|
- FileUtils.rm_rf(file)
- end
-end
-
if File.expand_path(__FILE__) =~ %r{([^\w/\.-])}
abort "The bundler specs cannot be run from a path that contains special characters (particularly #{$1.inspect})"
end