Skip to content

Instantly share code, notes, and snippets.

@lporras
Created January 13, 2011 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lporras/778092 to your computer and use it in GitHub Desktop.
Save lporras/778092 to your computer and use it in GitHub Desktop.
rake for run all rspec test with rcov.
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
@lporras
Copy link
Author

lporras commented Jan 13, 2011

@lporras
Copy link
Author

lporras commented Jan 13, 2011

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment