Skip to content

Commit

Permalink
Try to run compat tests with Rake::TestTask
Browse files Browse the repository at this point in the history
This should make the compat specs run under integrity
installs at Heroku.
  • Loading branch information
sr authored and rtomayko committed Apr 26, 2009
1 parent c31a2b8 commit caca9ab
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions Rakefile
Expand Up @@ -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
Expand All @@ -16,18 +18,17 @@ desc "Run < 0.9.x compatibility specs"
task :compat do
begin
require 'mocha'
rescue LoadError
puts 'WARN: skipping compat tests. mocha gem required.'
next
end
require 'test/spec'
at_exit { exit 0 } # disable test-spec at_exit runner

if ! system('specrb --help &>/dev/null')
puts 'WARN: skipping compat tests. test-spec gem required.'
next
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
warn 'Skipping compat tests. mocha and/or test-spec gems not installed.'
end

pattern = ENV['TEST'] || '.*'
sh "specrb --testcase '#{pattern}' -Ilib:test compat/*_test.rb"
end

# PACKAGING ============================================================
Expand Down

0 comments on commit caca9ab

Please sign in to comment.