diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2011-11-08 22:15:29 -0800 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2011-11-08 22:15:29 -0800 |
commit | 2843d3b2775e0e4d31f3269b12fcf832c4c27421 (patch) | |
tree | fed9beafe5f3448a21c296d9b31da0c3f144be01 /railties | |
parent | 6e87281b5f9f6f7abf0ef93448c63396419f1920 (diff) | |
parent | 5f826ea26f048df941325427c841608ced86f7a1 (diff) | |
download | rails-2843d3b2775e0e4d31f3269b12fcf832c4c27421.tar.gz rails-2843d3b2775e0e4d31f3269b12fcf832c4c27421.tar.bz2 rails-2843d3b2775e0e4d31f3269b12fcf832c4c27421.zip |
Merge pull request #3574 from arunagw/refactor_testing_uncommitted_task
Refactor test:uncommitted task.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/test_unit/testing.rake | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/railties/lib/rails/test_unit/testing.rake b/railties/lib/rails/test_unit/testing.rake index 8bcceb9b2c..52d92cdd96 100644 --- a/railties/lib/rails/test_unit/testing.rake +++ b/railties/lib/rails/test_unit/testing.rake @@ -121,16 +121,9 @@ namespace :test do models = changed_since_checkin.select { |path| path =~ /app[\\\/]models[\\\/].*\.rb$/ } controllers = changed_since_checkin.select { |path| path =~ /app[\\\/]controllers[\\\/].*\.rb$/ } - unit_tests = models.map do |model| - file = "test/unit/#{File.basename(model, '.rb')}_test.rb" - file if File.exist?(file) - end - functional_tests = controllers.map do |controller| - file = "test/functional/#{File.basename(controller, '.rb')}_test.rb" - file if File.exist?(file) - end - - (unit_tests.uniq + functional_tests.uniq).compact + unit_tests = models.map { |model| "test/unit/#{File.basename(model, '.rb')}_test.rb" } + functional_tests = controllers.map { |controller| "test/functional/#{File.basename(controller, '.rb')}_test.rb" } + (unit_tests + functional_tests).uniq.select { |file| File.exist?(file) } end t.libs << 'test' |