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:
parent
fc7f179a34
commit
24feb801f5
15
Rakefile
15
Rakefile
|
@ -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
1
test/adapters/mysql.rb
Normal file
|
@ -0,0 +1 @@
|
|||
ENV["ARE_DB"] = "mysql"
|
1
test/adapters/postgresql.rb
Normal file
1
test/adapters/postgresql.rb
Normal file
|
@ -0,0 +1 @@
|
|||
ENV["ARE_DB"] = "postgresql"
|
1
test/adapters/sqlite3.rb
Normal file
1
test/adapters/sqlite3.rb
Normal file
|
@ -0,0 +1 @@
|
|||
ENV["ARE_DB"] = "sqlite3"
|
|
@ -3,7 +3,7 @@ common: &common
|
|||
password:
|
||||
encoding: utf8
|
||||
host: localhost
|
||||
database: aroptests
|
||||
database: activerecord_import_test
|
||||
|
||||
mysql:
|
||||
<<: *common
|
||||
|
|
Loading…
Reference in a new issue