diff options
author | francis <francis> | 2007-11-01 05:35:40 +0000 |
---|---|---|
committer | francis <francis> | 2007-11-01 05:35:40 +0000 |
commit | 5aeb7d884e40291b00e424b5df43e6abbd931051 (patch) | |
tree | b44f349ac558c33e35806004a6584b1db99c6280 /vendor/plugins/rake_tasks/tasks/spec.rake | |
parent | 28fb182fa965467b73ad0b9bea506de8050305d3 (diff) |
Make "rake spec:check" not check views or helpers, as I don't think
we need specialist test files for them (and even if I did they
are screwed, as they can't call functions in controllers/views/routes
from the test framework).
Move various link to URL helpers into their own file, for ease of
calling from views and controllers.
Document Spec directory in top level README.
Diffstat (limited to 'vendor/plugins/rake_tasks/tasks/spec.rake')
-rw-r--r-- | vendor/plugins/rake_tasks/tasks/spec.rake | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/vendor/plugins/rake_tasks/tasks/spec.rake b/vendor/plugins/rake_tasks/tasks/spec.rake index 9f07b0100..a4d608d1b 100644 --- a/vendor/plugins/rake_tasks/tasks/spec.rake +++ b/vendor/plugins/rake_tasks/tasks/spec.rake @@ -25,7 +25,9 @@ namespace :spec do files = {} `find #{PROJ_DIR} -name '*.rb'`.split(/\n/).each do |file| spec_file = file.sub('/app/', '/spec/').sub('.rb', '_spec.rb') - type = (File.dirname(file).split("/").last == "models" ? "model" : "controller") + dir_type = File.dirname(file).split("/").last + next if dir_type == "helpers" + type = (dir_type == "models" ? "model" : "controller") File.exists?(spec_file) ? next : files[spec_file] = type end files @@ -43,7 +45,8 @@ namespace :spec do desc "Check files in the app directory for corresponding test files in the spec directory." task :check do - files = find_untested_ruby_files.merge(find_untested_view_files) + # XXX Don't check views, as we use controllers for view tests. Francis. + files = find_untested_ruby_files #.merge(find_untested_view_files) unless files.empty? puts "Missing test files:" files.each {|file, type| puts " #{file}"} |