diff options
Diffstat (limited to 'spec/support/builders.rb')
-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 |