Permalink
Browse files

Run normal and compat specs with default rake task

The previous behavior was to run only the main test suite, which led
to missed compat issues. You can get the old behavior by running
"rake test" explicitly.
  • Loading branch information...
1 parent 49adaa5 commit c76a68e59f79df706cbb64b4d4cf31c2feaa9936 @rtomayko rtomayko committed Mar 31, 2009
Showing with 8 additions and 4 deletions.
  1. +8 −4 Rakefile
View
12 Rakefile
@@ -2,7 +2,7 @@ require 'rake/clean'
require 'rake/testtask'
require 'fileutils'
-task :default => [:test]
+task :default => [:test, :compat]
task :spec => :test
# SPECS ===============================================================
@@ -12,10 +12,14 @@ Rake::TestTask.new(:test) do |t|
t.ruby_opts = ['-rubygems'] if defined? Gem
end
-desc 'Run compatibility specs (requires test/spec)'
+desc 'Run compatibility specs (requires test-spec)'
task :compat do |t|
- pattern = ENV['TEST'] || '.*'
- sh "specrb --testcase '#{pattern}' -Ilib:test compat/*_test.rb"
+ if ENV['PATH'].split(':').any? { |p| File.exist?("#{p}/specrb") }
+ pattern = ENV['TEST'] || '.*'
+ sh "specrb --testcase '#{pattern}' -Ilib:test compat/*_test.rb"
+ else
+ puts "WARN: skipping compat tests. test-spec and mocha gems required."
+ end
end
# PACKAGING ============================================================

0 comments on commit c76a68e

Please sign in to comment.