2010-03-14 02:20:55 +01:00
|
|
|
require 'rake/testtask'
|
|
|
|
|
2010-04-09 02:57:10 +02:00
|
|
|
task :default => ["display:notice"]
|
2010-03-14 02:20:55 +01:00
|
|
|
|
2010-08-11 02:47:55 +02:00
|
|
|
ADAPTERS = %w(mysql postgresql sqlite3)
|
2010-04-09 02:57:10 +02:00
|
|
|
|
|
|
|
namespace :display do
|
|
|
|
task :notice do
|
|
|
|
puts
|
|
|
|
puts "To run tests you must supply the adapter, see rake -T for more information."
|
|
|
|
puts
|
|
|
|
end
|
|
|
|
end
|
2010-03-14 02:20:55 +01:00
|
|
|
|
|
|
|
ADAPTERS.each do |adapter|
|
|
|
|
namespace :test do
|
2010-08-11 02:47:55 +02:00
|
|
|
desc "Runs #{adapter} database tests."
|
|
|
|
Rake::TestTask.new(adapter) do |t|
|
|
|
|
t.test_files = FileList["test/adapters/#{adapter}.rb", "test/*_test.rb", "test/#{adapter}/**/*_test.rb"]
|
2010-03-14 02:20:55 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|