retr0h (owner)

Revisions

gist: 79988 Download_button fork
public
Public Clone URL: git://gist.github.com/79988.git
Embed All Files: show embed
Text only #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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