mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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
This commit is contained in:
parent
9840dc84f1
commit
f1a350a05c
1 changed files with 9 additions and 4 deletions
|
@ -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
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue