Skip to content

Instantly share code, notes, and snippets.

@kylefox
Created November 26, 2009 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kylefox/243658 to your computer and use it in GitHub Desktop.
Save kylefox/243658 to your computer and use it in GitHub Desktop.
# From http://lojic.com/blog/2009/02/26/setup-shoulda-and-rcov-for-rails-222/
namespace :test do
desc 'Measures test coverage'
task :coverage do
rm_f "coverage"
rm_f "coverage.data"
rcov = "rcov -Itest --rails --aggregate coverage.data -x \" rubygems/*,/Library/Ruby/Site/*,gems/*,rcov*\""
system("#{rcov} test/unit/*_test.rb")
system("#{rcov} test/functional/admin/*_test.rb")
system("#{rcov} --html test/integration/admin/*_test.rb")
# system("#{rcov} --no-html test/unit/helpers/*_test.rb")
# system("#{rcov} --no-html test/functional/*_test.rb")
# system("#{rcov} --html test/integration/*_test.rb")
system("open coverage/index.html") if PLATFORM['darwin']
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment