Created
October 28, 2010 15:33
-
-
Save williamn/651601 to your computer and use it in GitHub Desktop.
This file contains 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
require 'rcov/rcovtask' | |
namespace :test do | |
namespace :coverage do | |
desc "Delete aggregate coverage data." | |
task(:clean) { rm_f "coverage.data" } | |
end | |
desc 'Aggregate code coverage for unit, functional and integration tests' | |
task :coverage => "test:coverage:clean" | |
%w[unit functional integration].each do |target| | |
namespace :coverage do | |
Rcov::RcovTask.new(target) do |t| | |
t.libs << "test" | |
t.test_files = FileList["test/#{target}/*_test.rb"] | |
t.output_dir = "test/coverage/#{target}" | |
t.verbose = true | |
t.rcov_opts << '--rails --exclude "gems/*" --aggregate coverage.data' | |
end | |
end | |
task :coverage => "test:coverage:#{target}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment