diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-03-29 19:21:20 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-04-03 12:16:19 -0400 |
commit | 37154c0c7a01f992c29fa5bbc53b7113d5ae8d77 (patch) | |
tree | 92c2bc589dac6a3995546b664ca71ed072babdfd /railties/lib | |
parent | 8c22235357f528854e313aee44c84f2995f9057d (diff) | |
download | rails-37154c0c7a01f992c29fa5bbc53b7113d5ae8d77.tar.gz rails-37154c0c7a01f992c29fa5bbc53b7113d5ae8d77.tar.bz2 rails-37154c0c7a01f992c29fa5bbc53b7113d5ae8d77.zip |
a test file can be provided to rake, e.g.:
rake test path/to/test.rb
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/test_unit/testing.rake | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/railties/lib/rails/test_unit/testing.rake b/railties/lib/rails/test_unit/testing.rake index 66b1dbe105..a66cfd1487 100644 --- a/railties/lib/rails/test_unit/testing.rake +++ b/railties/lib/rails/test_unit/testing.rake @@ -47,7 +47,16 @@ task default: :test desc 'Runs test:units, test:functionals, test:integration together' task :test do - Rake::Task[ENV['TEST'] ? 'test:single' : 'test:run'].invoke + tasks = Rake.application.top_level_tasks + test_files = tasks.grep(/^test\//) + if test_files.any? + Rails::TestTask.new('test:single') { |t| + t.test_files = test_files + } + Rake::Task['test:single'].invoke + else + Rake::Task[ENV['TEST'] ? 'test:single' : 'test:run'].invoke + end end namespace :test do |