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 ===============================================================
|
# SPECS ===============================================================
|
||||||
|
|
||||||
|
task(:test) { puts "==> Running main test suite" }
|
||||||
|
|
||||||
Rake::TestTask.new(:test) do |t|
|
Rake::TestTask.new(:test) do |t|
|
||||||
t.test_files = FileList['test/*_test.rb']
|
t.test_files = FileList['test/*_test.rb']
|
||||||
t.ruby_opts = ['-rubygems'] if defined? Gem
|
t.ruby_opts = ['-rubygems'] if defined? Gem
|
||||||
|
@ -16,18 +18,17 @@ desc "Run < 0.9.x compatibility specs"
|
||||||
task :compat do
|
task :compat do
|
||||||
begin
|
begin
|
||||||
require 'mocha'
|
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
|
rescue LoadError
|
||||||
puts 'WARN: skipping compat tests. mocha gem required.'
|
warn 'Skipping compat tests. mocha and/or test-spec gems not installed.'
|
||||||
next
|
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
# PACKAGING ============================================================
|
# PACKAGING ============================================================
|
||||||
|
|
Loading…
Reference in New Issue