diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-04-05 16:38:37 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-04-05 16:38:37 -0700 |
commit | 88cf64a6690e3c7cc05bd644bd5ad9a000192ebd (patch) | |
tree | 429feb9ee5a4631834dbcdcddc0cc6c71638757f /railties/lib/rails/test_unit | |
parent | 7f698da8878b141c5324b2419d73570f507ef08f (diff) | |
download | rails-88cf64a6690e3c7cc05bd644bd5ad9a000192ebd.tar.gz rails-88cf64a6690e3c7cc05bd644bd5ad9a000192ebd.tar.bz2 rails-88cf64a6690e3c7cc05bd644bd5ad9a000192ebd.zip |
extract test info from the command line and set up the test task
Diffstat (limited to 'railties/lib/rails/test_unit')
-rw-r--r-- | railties/lib/rails/test_unit/testing.rake | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/railties/lib/rails/test_unit/testing.rake b/railties/lib/rails/test_unit/testing.rake index bef819a8a8..9a3094b1b7 100644 --- a/railties/lib/rails/test_unit/testing.rake +++ b/railties/lib/rails/test_unit/testing.rake @@ -48,12 +48,14 @@ task default: :test desc 'Runs test:units, test:functionals, test:integration together' task :test do - tasks = Rake.application.top_level_tasks - test_files = tasks.grep(/^test\//) - if test_files.any? + info = Rails::TestTask.test_info Rake.application.top_level_tasks + if info.files.any? Rails::TestTask.new('test:single') { |t| - t.test_files = test_files + t.test_files = info.files } + ENV['TESTOPTS'] ||= info.opts + Rake.application.top_level_tasks.replace info.tasks + Rake::Task['test:single'].invoke else Rake::Task[ENV['TEST'] ? 'test:single' : 'test:run'].invoke |