From 883dfa618e50b3458b36cbcadc77679b28859b1f Mon Sep 17 00:00:00 2001 From: John Bintz Date: Mon, 6 Jun 2011 09:25:50 -0400 Subject: [PATCH] fix rake tasks for testing --- Rakefile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Rakefile b/Rakefile index b953835..b959b61 100644 --- a/Rakefile +++ b/Rakefile @@ -1,11 +1,8 @@ require 'bundler' Bundler::GemHelper.install_tasks +require 'rspec/core/rake_task' -desc "Run on this Ruby" -task :spec do - system %{rspec spec} - exit $?.exitstatus -end +RSpec::Core::RakeTask.new(:spec) namespace :spec do desc "Run on three Rubies" @@ -15,8 +12,9 @@ namespace :spec do fail = false %w{1.8.7 1.9.2 ree}.each do |version| puts "Switching to #{version}" - system %{rvm #{version}} - system %{rspec spec} + Bundler.with_clean_env do + system %{bash -c 'source ~/.rvm/scripts/rvm && rvm #{version} && bundle && bundle exec rake spec'} + end if $?.exitstatus != 0 fail = true break