summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-02-24 19:02:50 +0100
committerhukl <contact@smyck.org>2009-02-24 19:02:50 +0100
commitbe35d8a741812271f8d5b34e10fd0bb2469066e1 (patch)
tree8ed79f21314cd710ad483a430c25d11d6f87bccb /lib
parent7c0908f03f5ba9ebc103c4f3c984bf48675711be (diff)
put the rcov task into a seperate file so rcov is not necessary
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