summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2011-05-24 13:01:38 -0700
committerAndre Arko <andre@arko.net>2011-05-24 13:01:38 -0700
commit805259c77754a0a08c40895fe5be1ca832a5b59e (patch)
tree32a44879dcc294964f7d4b6a8baece2a65fb52d9
parente8e5244dcb23ee2107817acd31dfca92c7704dc2 (diff)
downloadbundler-805259c77754a0a08c40895fe5be1ca832a5b59e.tar.gz
clean up sudo tmp files after any sudo tests run
-rw-r--r--Rakefile21
1 files changed, 9 insertions, 12 deletions
diff --git a/Rakefile b/Rakefile
index b5fb1e78d1..363ab19926 100644
--- a/Rakefile
+++ b/Rakefile
@@ -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