diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-18 06:47:46 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-18 06:47:46 +0000 |
commit | f1a350a05c97d6e54e6dde26c101e8035d55e40c (patch) | |
tree | 45e51c168abdf282aee8c23bcfe8dfb1d7edd9b3 /railties | |
parent | 9840dc84f1727f91228250b874ba06dc97c631f0 (diff) | |
download | rails-f1a350a05c97d6e54e6dde26c101e8035d55e40c.tar.gz rails-f1a350a05c97d6e54e6dde26c101e8035d55e40c.tar.bz2 rails-f1a350a05c97d6e54e6dde26c101e8035d55e40c.zip |
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
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/tasks/testing.rake | 13 |
1 files 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 |