Permalink
Browse files

Restore `rake TEST=test/unit/foo_test.rb` support.

Add your own test tasks as dependencies on the `test:run` task instead of `test` itself.

  namespace :test do
    task run: 'test:acceptance'

    Rails::SubTestTask.new acceptance: 'test:prepare' do |t|
      t.libs << 'test'
      t.pattern = 'test/acceptance/**/*_test.rb'
    end
  end
  • Loading branch information...
1 parent 14c89e7 commit 4f629ed4bbb8902e8905dee3069edb1cd7e693b6 @jeremy jeremy committed Dec 21, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 railties/lib/rails/test_unit/testing.rake
@@ -83,13 +83,17 @@ end
task :default => :test
desc 'Runs test:units, test:functionals, test:integration together (also available: test:benchmark, test:profile, test:plugins)'
-task :test => %w(test:units test:functionals test:integration)
+task :test do
+ Rake::Task[ENV['TEST'] ? 'test:single' : 'test:run'].invoke
+end
namespace :test do
task :prepare do
# Placeholder task for other Railtie and plugins to enhance. See Active Record for an example.
end
+ task :run => %w(test:units test:functionals test:integration)
+
Rake::TestTask.new(:recent => "test:prepare") do |t|
since = TEST_CHANGES_SINCE
touched = FileList['test/**/*_test.rb'].select { |path| File.mtime(path) > since } +

0 comments on commit 4f629ed

Please sign in to comment.