diff options
author | Andre Arko <andre@arko.net> | 2015-08-23 02:11:58 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2015-08-23 02:11:58 -0700 |
commit | 507ea45c54177c823ab17df70f87e86fd1d1a1b7 (patch) | |
tree | ae61bd9907ef76d7d9455aa7ac441965444ede87 | |
parent | b8e754c8523c8c3ba4562a536cb03e91e6d14f67 (diff) | |
download | bundler-507ea45c54177c823ab17df70f87e86fd1d1a1b7.tar.gz |
try to install test system gems if missing
-rw-r--r-- | spec/support/builders.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/support/builders.rb b/spec/support/builders.rb index dd54d765b0..fe9b2ba4d7 100644 --- a/spec/support/builders.rb +++ b/spec/support/builders.rb @@ -298,12 +298,20 @@ module Spec def build_repo(path, &blk) return if File.directory?(path) rake_path = Dir["#{Path.base_system_gems}/**/rake*.gem"].first + + if rake_path.nil? + Spec::Path.base_system_gems.rmtree + Spec::Rubygems.setup + rake_path = Dir["#{Path.base_system_gems}/**/rake*.gem"].first + end + if rake_path FileUtils.mkdir_p("#{path}/gems") FileUtils.cp rake_path, "#{path}/gems/" else - abort "You need to `rm -rf #{tmp}`" + abort "Your test gems are missing! Run `rm -rf #{tmp}` and try again." end + update_repo(path, &blk) end |