1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

Update compat test task so that it works on Heroku

This commit is contained in:
Simon Rozet 2009-04-19 19:16:34 +02:00
parent 4658f4b0f0
commit 8df2d63361

View file

@ -12,13 +12,19 @@ Rake::TestTask.new(:test) do |t|
t.ruby_opts = ['-rubygems'] if defined? Gem
end
desc 'Run compatibility specs (requires test-spec)'
task :compat do |t|
if ENV['PATH'].split(':').any? { |p| File.exist?("#{p}/specrb") }
task :compat do
begin
require 'mocha'
rescue LoadError
puts 'WARN: skipping compat tests. mocha gem required.'
exit
end
if system('testrb --help &>/dev/null')
pattern = ENV['TEST'] || '.*'
sh "specrb --testcase '#{pattern}' -Ilib:test compat/*_test.rb"
else
puts "WARN: skipping compat tests. test-spec and mocha gems required."
puts 'WARN: skipping compat tests. test-spec gem required.'
end
end