mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
Fix specrb detection in rake compat task
This commit is contained in:
parent
54794fc823
commit
0ceb73c85f
1 changed files with 7 additions and 5 deletions
12
Rakefile
12
Rakefile
|
@ -12,20 +12,22 @@ Rake::TestTask.new(:test) do |t|
|
|||
t.ruby_opts = ['-rubygems'] if defined? Gem
|
||||
end
|
||||
|
||||
desc "Run < 0.9.x compatibility specs"
|
||||
task :compat do
|
||||
begin
|
||||
require 'mocha'
|
||||
rescue LoadError
|
||||
puts 'WARN: skipping compat tests. mocha gem required.'
|
||||
exit
|
||||
next
|
||||
end
|
||||
|
||||
if system('testrb --help &>/dev/null')
|
||||
pattern = ENV['TEST'] || '.*'
|
||||
sh "specrb --testcase '#{pattern}' -Ilib:test compat/*_test.rb"
|
||||
else
|
||||
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 ============================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue