summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/coverage.rake24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/tasks/coverage.rake b/lib/tasks/coverage.rake
new file mode 100644
index 0000000..b70f813
--- /dev/null
+++ b/lib/tasks/coverage.rake
@@ -0,0 +1,24 @@
1require 'rcov/rcovtask'
2
3namespace :test do
4 namespace :coverage do
5 desc "Delete aggregate coverage data."
6 task(:clean) { rm_f "coverage.data" }
7 end
8
9 desc 'Aggregate code coverage for unit, functional and integration tests'
10 task :coverage => "test:coverage:clean"
11 %w[unit functional integration].each do |target|
12 namespace :coverage do
13 Rcov::RcovTask.new(target) do |t|
14 t.libs << "test"
15 t.test_files = FileList["test/#{target}/*_test.rb"]
16 t.output_dir = "test/coverage/#{target}"
17 t.verbose = true
18 t.rcov_opts << '--rails --aggregate coverage.data'
19 end
20 end
21
22 task :coverage => "test:coverage:#{target}"
23 end
24end \ No newline at end of file