diff options
-rw-r--r-- | spec/runtime/setup_spec.rb | 6 | ||||
-rw-r--r-- | spec/spec_helper.rb | 12 |
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 |