Skip to content

Instantly share code, notes, and snippets.

@krames
Created July 2, 2011 14:43
Show Gist options
  • Save krames/1060577 to your computer and use it in GitHub Desktop.
Save krames/1060577 to your computer and use it in GitHub Desktop.
Rcov rake task
namespace :test do
desc "Generate code coverage with rcov"
task :coverage do
rm_rf "doc/coverage/coverage.data"
rm_rf "doc/coverage"
mkdir "doc/coverage"
rcov = %(rcov --rails --aggregate doc/coverage/coverage.data --exclude gems --text-summary -Ilib:test --html -o doc/coverage test/**/*_test.rb)
system rcov
system "open doc/coverage/index.html" if PLATFORM['darwin']
end
end
@krames
Copy link
Author

krames commented Jul 2, 2011

There seems to be a lack of working rcov rake tasks out there, so I though I would share mine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment