Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 36 lines (30 sloc) 1.116 kb
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
PROJECT_ROOT = File.dirname(__FILE__)
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'tasks/rails'
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 all].each do |target|
namespace :coverage do
Rcov::RcovTask.new(target) do |t|
t.libs << "test"
t.test_files = FileList["test/#{target}/*_test.rb"]
t.test_files = FileList["test/**/*_test.rb"] if target == 'all'
t.output_dir = "test/coverage/#{target}"
t.verbose = true
t.rcov_opts << '--rails --aggregate coverage/data'
end
end
task :coverage => "test:coverage:#{target}"
end
end
Jump to Line
Something went wrong with that request. Please try again.