Permalink
Browse files

[Rakefile] Add dedicated coverge task

Enambling coverage was leading to bacon exiting with a 0 exit code even
in case of failures disabling the tests (at least locally)
  • Loading branch information...
fabiopelosin committed Dec 20, 2013
1 parent 245f2fc commit 95a6f9061022fe428de027655c9c7151dddbc0ca
Showing with 8 additions and 2 deletions.
  1. +8 −2 Rakefile
View
@@ -126,8 +126,6 @@ namespace :spec do
end
task :all do
- ENV['GENERATE_COVERAGE'] = 'true'
-
title "Running Unit Tests"
sh "bundle exec bacon #{specs('**')}"
@@ -154,6 +152,14 @@ task :spec => 'spec:all'
# Rubocop
#-----------------------------------------------------------------------------#
+desc 'Generates a coverage report'
+task :coverage do
+ title "Generating Coverage Report"
+ sh "GENERATE_COVERAGE=true bundle exec bacon --quiet #{specs('**')}"
+ puts "\nCoverage report available at `coverage/index.html`"
+ sh "open coverage/index.html"
+end
+
desc 'Checks code style'
task :rubocop do
if RUBY_VERSION >= '1.9.3'

0 comments on commit 95a6f90

Please sign in to comment.