From 0ceb73c85f6899de00577fc0969e78c7fd2e31dc Mon Sep 17 00:00:00 2001 From: Ryan Tomayko Date: Sat, 25 Apr 2009 06:37:09 -0700 Subject: [PATCH] Fix specrb detection in rake compat task --- Rakefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Rakefile b/Rakefile index 4154c7ea..27a5b922 100644 --- a/Rakefile +++ b/Rakefile @@ -12,20 +12,22 @@ Rake::TestTask.new(:test) do |t| t.ruby_opts = ['-rubygems'] if defined? Gem end +desc "Run < 0.9.x compatibility specs" task :compat do begin require 'mocha' rescue LoadError puts 'WARN: skipping compat tests. mocha gem required.' - exit + next end - if system('testrb --help &>/dev/null') - pattern = ENV['TEST'] || '.*' - sh "specrb --testcase '#{pattern}' -Ilib:test compat/*_test.rb" - else + if ! system('specrb --help &>/dev/null') puts 'WARN: skipping compat tests. test-spec gem required.' + next end + + pattern = ENV['TEST'] || '.*' + sh "specrb --testcase '#{pattern}' -Ilib:test compat/*_test.rb" end # PACKAGING ============================================================