diff options
author | Carl Lerche <carllerche@mac.com> | 2010-08-10 19:49:32 -0700 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2010-08-10 19:50:05 -0700 |
commit | 6cc134ca437c0c92df240c1a5fb4ee65973a0a30 (patch) | |
tree | ecaf68a84ce88ebfa6ba219c51981ebda7d82c2d /Rakefile | |
parent | 62d9fc9d9ce3c5a0933c6091e3eb3d8530908d5f (diff) | |
download | bundler-6cc134ca437c0c92df240c1a5fb4ee65973a0a30.tar.gz |
Add a task that runs the specs including sudo specs
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 27 |
1 files changed, 24 insertions, 3 deletions
@@ -12,11 +12,13 @@ def gemspec end end +def sudo? + ENV['BUNDLER_SUDO_TESTS'] +end + begin require 'rspec/core/rake_task' -rescue LoadError - raise 'Run `gem install rspec` to be able to run specs' -else + task :clear_tmp do FileUtils.rm_rf(File.expand_path("../tmp", __FILE__)) end @@ -27,6 +29,25 @@ else t.warning = true end task :spec + + namespace :spec do + task :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 + end + + desc "Run the full spec suite including SUDO tests" + task :full => ["sudo", "clean", "spec"] + end +rescue LoadError + raise 'Run `gem install rspec` to be able to run specs' end |