Skip to content

Instantly share code, notes, and snippets.

@chad
Created January 6, 2010 15:20
Show Gist options
  • Save chad/270329 to your computer and use it in GitHub Desktop.
Save chad/270329 to your computer and use it in GitHub Desktop.
namespace :test do
desc 'Measures test coverage'
task :coverage do
rm_f "coverage"
rm_f "coverage.data"
rcov = "rcov --rails --aggregate coverage.data --text-summary -Ilib -Itest -x /ruby\/1.8\/gems -x /Gems\/1\.8 -x /Library\/Ruby -x /Library\/Frameworks"
system("#{rcov} --no-html test/unit/*_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