diff options
author | Andre Arko <andre@arko.net> | 2011-05-24 13:01:38 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2011-05-24 13:01:38 -0700 |
commit | 805259c77754a0a08c40895fe5be1ca832a5b59e (patch) | |
tree | 32a44879dcc294964f7d4b6a8baece2a65fb52d9 /Rakefile | |
parent | e8e5244dcb23ee2107817acd31dfca92c7704dc2 (diff) | |
download | bundler-805259c77754a0a08c40895fe5be1ca832a5b59e.tar.gz |
clean up sudo tmp files after any sudo tests run
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 21 |
1 files changed, 9 insertions, 12 deletions
@@ -3,10 +3,6 @@ $:.unshift File.expand_path("../lib", __FILE__) require 'bundler/gem_helper' Bundler::GemHelper.install_tasks -def sudo? - ENV['BUNDLER_SUDO_TESTS'] -end - begin # set up rspec tasks require 'rspec/core/rake_task' @@ -42,19 +38,20 @@ begin end namespace :spec do + task :clean do + rm_rf 'tmp' + end + desc "Run the spec suite with the sudo tests" - task :sudo => ["set_sudo", "clean", "spec"] + task :sudo => ["set_sudo", "spec", "clean_sudo"] task :set_sudo do ENV['BUNDLER_SUDO_TESTS'] = '1' end - task :clean do - if sudo? - system "sudo rm -rf #{File.expand_path('../tmp', __FILE__)}" - else - rm_rf 'tmp' - end + task :clean_sudo do + puts "Cleaning up sudo test files..." + system "sudo rm -rf #{File.expand_path('../tmp/sudo_gem_home', __FILE__)}" end namespace :rubygems do @@ -69,7 +66,7 @@ begin # Create tasks like spec:rubygems:v1.8.3:sudo to run the sudo specs namespace rg do - task :sudo => ["set_sudo", rg] + task :sudo => ["set_sudo", rg, "clean_sudo"] end task "clone_rubygems_#{rg}" do |