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:
parent
4658f4b0f0
commit
8df2d63361
1 changed files with 10 additions and 4 deletions
14
Rakefile
14
Rakefile
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue