Updated how tests are run so Rake is not invoked twice.

* removing support for Oracle in the rakefile as it is no currently supported
This commit is contained in:
Zach Dennis 2010-08-10 20:47:55 -04:00
parent fc7f179a34
commit 24feb801f5
5 changed files with 8 additions and 12 deletions

View file

@ -2,7 +2,7 @@ require 'rake/testtask'
task :default => ["display:notice"]
ADAPTERS = %w(mysql postgresql sqlite3 oracle)
ADAPTERS = %w(mysql postgresql sqlite3)
namespace :display do
task :notice do
@ -12,18 +12,11 @@ namespace :display do
end
end
desc "Runs generic database tests."
Rake::TestTask.new("test") { |t|
t.test_files = FileList["test/*_test.rb", "test/#{ENV['ARE_DB']}/**/*_test.rb"]
}
ADAPTERS.each do |adapter|
namespace :test do
desc "Runs unit tests for #{adapter} specific functionality"
task adapter do
ENV["ARE_DB"] = adapter
exec "rake test"
# exec replaces the current process, never gets here
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"]
end
end
end

1
test/adapters/mysql.rb Normal file
View file

@ -0,0 +1 @@
ENV["ARE_DB"] = "mysql"

View file

@ -0,0 +1 @@
ENV["ARE_DB"] = "postgresql"

1
test/adapters/sqlite3.rb Normal file
View file

@ -0,0 +1 @@
ENV["ARE_DB"] = "sqlite3"

View file

@ -3,7 +3,7 @@ common: &common
password:
encoding: utf8
host: localhost
database: aroptests
database: activerecord_import_test
mysql:
<<: *common