Skip to content
This repository
Browse code

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...
commit c76a68e59f79df706cbb64b4d4cf31c2feaa9936 1 parent 49adaa5
Ryan Tomayko authored March 31, 2009

Showing 1 changed file with 8 additions and 4 deletions. Show diff stats Hide diff stats

  1. 12  Rakefile
12  Rakefile
@@ -2,7 +2,7 @@ require 'rake/clean'
2 2
 require 'rake/testtask'
3 3
 require 'fileutils'
4 4
 
5  
-task :default => [:test]
  5
+task :default => [:test, :compat]
6 6
 task :spec => :test
7 7
 
8 8
 # SPECS ===============================================================
@@ -12,10 +12,14 @@ Rake::TestTask.new(:test) do |t|
12 12
   t.ruby_opts = ['-rubygems'] if defined? Gem
13 13
 end
14 14
 
15  
-desc 'Run compatibility specs (requires test/spec)'
  15
+desc 'Run compatibility specs (requires test-spec)'
16 16
 task :compat do |t|
17  
-  pattern = ENV['TEST'] || '.*'
18  
-  sh "specrb --testcase '#{pattern}' -Ilib:test compat/*_test.rb"
  17
+  if ENV['PATH'].split(':').any? { |p| File.exist?("#{p}/specrb") }
  18
+    pattern = ENV['TEST'] || '.*'
  19
+    sh "specrb --testcase '#{pattern}' -Ilib:test compat/*_test.rb"
  20
+  else
  21
+    puts "WARN: skipping compat tests. test-spec and mocha gems required."
  22
+  end
19 23
 end
20 24
 
21 25
 # PACKAGING ============================================================

0 notes on commit c76a68e

Please sign in to comment.
Something went wrong with that request. Please try again.