Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 4f629ed4bbb8902e8905dee3069edb1cd7e693b6 1 parent 14c89e7
@jeremy jeremy authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 railties/lib/rails/test_unit/testing.rake
View
6 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 } +
Please sign in to comment.
Something went wrong with that request. Please try again.