Try to run compat tests with Rake::TestTask
This should make the compat specs run under integrity installs at Heroku.
This commit is contained in:
parent
c31a2b8544
commit
caca9abd4c
21
Rakefile
21
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 ============================================================
|
||||
|
|
Loading…
Reference in New Issue