From caca9abd4ccbb4ee0cdfe1ff0963201bc3819d93 Mon Sep 17 00:00:00 2001 From: Simon Rozet Date: Mon, 20 Apr 2009 17:12:54 +0200 Subject: [PATCH] Try to run compat tests with Rake::TestTask This should make the compat specs run under integrity installs at Heroku. --- Rakefile | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Rakefile b/Rakefile index 27a5b922..c541c340 100644 --- a/Rakefile +++ b/Rakefile @@ -7,6 +7,8 @@ task :spec => :test # SPECS =============================================================== +task(:test) { puts "==> Running main test suite" } + Rake::TestTask.new(:test) do |t| t.test_files = FileList['test/*_test.rb'] t.ruby_opts = ['-rubygems'] if defined? Gem @@ -16,18 +18,17 @@ desc "Run < 0.9.x compatibility specs" task :compat do begin require 'mocha' + require 'test/spec' + at_exit { exit 0 } # disable test-spec at_exit runner + + puts "==> Running compat test suite" + Rake::TestTask.new(:compat) do |t| + t.test_files = FileList['compat/*_test.rb'] + t.ruby_opts = ['-rubygems'] if defined? Gem + end rescue LoadError - puts 'WARN: skipping compat tests. mocha gem required.' - next + warn 'Skipping compat tests. mocha and/or test-spec gems not installed.' end - - 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 ============================================================