aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorwangjohn <wangjohn@mit.edu>2013-05-02 11:16:20 -0400
committerwangjohn <wangjohn@mit.edu>2013-05-02 11:16:20 -0400
commit062a93a05e11e1307efc950ef03b20a88630e6de (patch)
treed3a8edc1a95486de9ab5568433cb6b498c67e9d6 /railties
parentca2bc303a9764f23aa1b610c6b06cadbb23d5408 (diff)
downloadrails-062a93a05e11e1307efc950ef03b20a88630e6de.tar.gz
rails-062a93a05e11e1307efc950ef03b20a88630e6de.tar.bz2
rails-062a93a05e11e1307efc950ef03b20a88630e6de.zip
Refactoring the creation of TestTasks to remove code duplication.
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/test_unit/testing.rake22
1 files changed, 4 insertions, 18 deletions
diff --git a/railties/lib/rails/test_unit/testing.rake b/railties/lib/rails/test_unit/testing.rake
index 877dd6d254..9263b9b81d 100644
--- a/railties/lib/rails/test_unit/testing.rake
+++ b/railties/lib/rails/test_unit/testing.rake
@@ -121,31 +121,17 @@ namespace :test do
Rails::TestTask.new(single: "test:prepare")
- Rails::TestTask.new(models: "test:prepare") do |t|
- t.pattern = 'test/models/**/*_test.rb'
- end
-
- Rails::TestTask.new(helpers: "test:prepare") do |t|
- t.pattern = 'test/helpers/**/*_test.rb'
+ ["models", "helpers", "controllers", "mailers", "integration"].each do |name|
+ Rails::TestTask.new(name => "test:prepare") do |t|
+ t.pattern = "test/#{name}/**/*_test.rb"
+ end
end
Rails::TestTask.new(units: "test:prepare") do |t|
t.pattern = 'test/{models,helpers,unit}/**/*_test.rb'
end
- Rails::TestTask.new(controllers: "test:prepare") do |t|
- t.pattern = 'test/controllers/**/*_test.rb'
- end
-
- Rails::TestTask.new(mailers: "test:prepare") do |t|
- t.pattern = 'test/mailers/**/*_test.rb'
- end
-
Rails::TestTask.new(functionals: "test:prepare") do |t|
t.pattern = 'test/{controllers,mailers,functional}/**/*_test.rb'
end
-
- Rails::TestTask.new(integration: "test:prepare") do |t|
- t.pattern = 'test/integration/**/*_test.rb'
- end
end