From f1a350a05c97d6e54e6dde26c101e8035d55e40c Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 18 Mar 2006 06:47:46 +0000 Subject: Testing of uncommited should test controllers too (closes #4265) [technomancy@gmail.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3920 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/lib/tasks/testing.rake | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/railties/lib/tasks/testing.rake b/railties/lib/tasks/testing.rake index f5ccc1a19b..c735c8dbb9 100644 --- a/railties/lib/tasks/testing.rake +++ b/railties/lib/tasks/testing.rake @@ -52,9 +52,14 @@ namespace :test do Rake::TestTask.new(:uncommitted => "db:test:prepare") do |t| def t.file_list changed_since_checkin = silence_stderr { `svn status` }.map { |path| path.chomp[7 .. -1] } - models = changed_since_checkin.select { |path| path =~ /app\/models\/.*\.rb/ } - tests = models.map { |model| "test/unit/#{File.basename(model, '.rb')}_test.rb" } - tests.uniq + + models = changed_since_checkin.select { |path| path =~ /app\/models\/.*\.rb/ } + controllers = changed_since_checkin.select { |path| path =~ /app\/controllers\/.*\.rb/ } + + 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.uniq + functional_tests.uniq end t.libs << 'test' @@ -94,4 +99,4 @@ namespace :test do t.verbose = true end -end \ No newline at end of file +end -- cgit v1.2.3