Created
January 13, 2011 16:03
-
-
Save lporras/778092 to your computer and use it in GitHub Desktop.
rake for run all rspec test with rcov.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'rspec/core/rake_task' | |
require "rspec" | |
namespace :test do | |
desc "Run all specs." | |
Rspec::Core::RakeTask.new(:spec) do |t| | |
t.pattern = 'spec/**/*_spec.rb' | |
t.verbose = false | |
end | |
Rspec::Core::RakeTask.new(:coverage) do |t| | |
t.rcov = true | |
t.verbose = true | |
t.rcov_opts = %[-Ilib -Ispec --exclude "gems/*,features"] | |
t.rcov_opts << %[--text-report --sort coverage --html --aggregate coverage.data] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I create a file in lib/tasks called rspec.rake, and when I want to run all rspec test with coverage I run the command: rake test:coverage