Permalink
Browse files

Merge pull request #3574 from arunagw/refactor_testing_uncommitted_task

Refactor test:uncommitted task.
  • Loading branch information...
2 parents 6e87281 + 5f826ea commit 2843d3b2775e0e4d31f3269b12fcf832c4c27421 @vijaydev vijaydev committed Nov 9, 2011
Showing with 3 additions and 10 deletions.
  1. +3 −10 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'

0 comments on commit 2843d3b

Please sign in to comment.