summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2018-07-09 21:24:37 -0700
committerAndre Arko <andre@arko.net>2018-07-09 21:24:37 -0700
commit67f026cc6aa3d1fccae250f8243dafab1f96cf74 (patch)
tree577054624bc411a7db9db7c3b12fd18dc8da784d
parentec39b742f0f6ace27302649ac63a57400fbaf454 (diff)
downloadbundler-67f026cc6aa3d1fccae250f8243dafab1f96cf74.tar.gz
use FileUtils _after_ it is required
-rw-r--r--spec/spec_helper.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 1685178a34..1d4d4b537e 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -12,13 +12,6 @@ module Gem
end
end
-# Delete any copies of Bundler that have been dumped into site_ruby without
-# a gemspec. RubyGems cannot manage that Bundler, and so our tricks to make
-# sure that the correct version of Bundler loads will stop working.
-Dir.glob(File.join(RbConfig::CONFIG["sitelibdir"], "bundler*")).each do |f|
- FileUtils.rm_rf f
-end
-
begin
require File.expand_path("../support/path.rb", __FILE__)
spec = Gem::Specification.load(Spec::Path.gemspec.to_s)
@@ -35,6 +28,13 @@ require "bundler/vendored_fileutils"
require "uri"
require "digest"
+# Delete any copies of Bundler that have been dumped into site_ruby without
+# a gemspec. RubyGems cannot manage that Bundler, and so our tricks to make
+# sure that the correct version of Bundler loads will stop working.
+Dir.glob(File.join(RbConfig::CONFIG["sitelibdir"], "bundler*")).each do |f|
+ FileUtils.rm_rf f
+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