Skip to content

Instantly share code, notes, and snippets.

@dpisarewski
Created July 13, 2012 20:34
Show Gist options
  • Save dpisarewski/3107282 to your computer and use it in GitHub Desktop.
Save dpisarewski/3107282 to your computer and use it in GitHub Desktop.
Rcov tasks for RSpec and Cucumber
if Gem.available?('rspec')
require 'rspec/core/rake_task'
desc "Run all specs with rcov"
RSpec::Core::RakeTask.new("spec:coverage") do |t|
t.rcov = true
t.rcov_opts = '-o rspec_coverage --rails --include views -Ispec --exclude gems\/,spec\/,features\/,seeds\/'
t.spec_opts = "-c -f h -o rspec.html"
end
end
if Gem.available?('cucumber')
require 'cucumber/rake/task'
desc "Run all features with rcov"
Cucumber::Rake::Task.new("cucumber:coverage") do |t|
t.rcov = true
t.rcov_opts = '-o cucumber_coverage --rails --include views -Ispec --exclude gems\/,spec\/,features\/,seeds\/'
t.cucumber_opts = "-f html -o cucumber.html"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment