Created
April 11, 2009 18:31
-
-
Save dejan/93667 to your computer and use it in GitHub Desktop.
rake test:coverage
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 :test do | |
RCOV = "rcov --rails --aggregate coverage.data --text-summary -Ilib" | |
def rcov_on(files_selector) | |
unless Dir[files_selector].size == 0 | |
system("#{RCOV} --html #{files_selector}") | |
end | |
end | |
desc 'Measures test coverage' | |
task :coverage do | |
rm_f "coverage" | |
rm_f "coverage.data" | |
rcov_on('test/unit/*_test.rb') | |
rcov_on('test/functional/*_test.rb') | |
rcov_on('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