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 ============================================================