From 54e37b12fdbc25d43bfe8ee1f11c4808dec3f465 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 6 Nov 2009 19:39:51 +0000 Subject: [PATCH] Add test:coverage task. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3011 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/tasks/testing.rake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/tasks/testing.rake b/lib/tasks/testing.rake index b9e2283af..4e944e1d9 100644 --- a/lib/tasks/testing.rake +++ b/lib/tasks/testing.rake @@ -1,6 +1,17 @@ ### From http://svn.geekdaily.org/public/rails/plugins/generally_useful/tasks/coverage_via_rcov.rake namespace :test do + desc 'Measures test coverage' + task :coverage do + rm_f "coverage" + rm_f "coverage.data" + rcov = "rcov --rails --aggregate coverage.data --text-summary -Ilib" + system("#{rcov} --no-html test/unit/*_test.rb") + system("#{rcov} --no-html test/functional/*_test.rb") + system("#{rcov} --html test/integration/*_test.rb") + system("open coverage/index.html") if PLATFORM['darwin'] + end + namespace :scm do namespace :setup do desc "Creates directory for test repositories"