Created
March 16, 2009 18:23
-
-
Save retr0h/79988 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :spec do | |
desc "Report uncovered view templates." | |
task :missing_view_templates => :environment do | |
EXTENSION = ENV['extention'] || 'haml' | |
APP_VIEWS_DIR = File.join('app', 'views') | |
SPEC_VIEWS_DIR = File.join('spec', 'views') | |
Dir[File.join(Rails.root, "#{APP_VIEWS_DIR}/**/*.html.#{EXTENSION}")].each do |file| | |
file.match(%r{^#{File.join(Rails.root, APP_VIEWS_DIR)}/(.*)\.html.#{EXTENSION}$}) | |
puts $1 unless File.exists?(File.join(Rails.root, SPEC_VIEWS_DIR, "#{$1}.html.#{EXTENSION}_spec.rb")) | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment