From ae8acf701b808b53780288e07fcce246998654af Mon Sep 17 00:00:00 2001 From: David Calavera Date: Mon, 14 Dec 2009 20:54:19 +0100 Subject: [PATCH] prevent rake to run the test suite three times when ENV['TEST'] is set --- railties/lib/rails/tasks/testing.rake | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/railties/lib/rails/tasks/testing.rake b/railties/lib/rails/tasks/testing.rake index 57857fb..10db5e7 100644 --- a/railties/lib/rails/tasks/testing.rake +++ b/railties/lib/rails/tasks/testing.rake @@ -40,7 +40,8 @@ end desc 'Run all unit, functional and integration tests' task :test do - errors = %w(test:units test:functionals test:integration).collect do |task| + tests_to_run = ENV['TEST'] ? %w(test:single) : %w(test:units test:functionals test:integration) + errors = tests_to_run.collect do |task| begin Rake::Task[task].invoke nil @@ -86,6 +87,10 @@ namespace :test do end Rake::Task['test:uncommitted'].comment = "Test changes since last checkin (only Subversion and Git)" + Rake::TestTask.new(:single => "db:test:prepare") do |t| + t.libs << "test" + end + Rake::TestTask.new(:units => "db:test:prepare") do |t| t.libs << "test" t.pattern = 'test/unit/**/*_test.rb' -- 1.6.5