Skip to content

Instantly share code, notes, and snippets.

@sritchie
Created November 3, 2010 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sritchie/661616 to your computer and use it in GitHub Desktop.
Save sritchie/661616 to your computer and use it in GitHub Desktop.
rake file for rcov
require 'cucumber/rake/task'
require 'rspec/core/rake_task'
namespace :rcov do
Cucumber::Rake::Task.new(:cucumber) do |t|
t.rcov = true
t.rcov_opts = %w{--rails --exclude spec\/,features\/ --aggregate coverage.data}
t.rcov_opts << %[-o "coverage"]
end
RSpec::Core::RakeTask.new(:rspec) do |t|
t.pattern = 'spec/**/*_spec.rb'
t.rcov = true
t.rcov_opts = %q[--rails --exclude "spec/*,gems/*,features/*" --aggregate "coverage.data"]
end
desc "Run both specs and features to generate aggregated coverage"
task :all do |t|
rm "coverage.data" if File.exist?("coverage.data")
Rake::Task["rcov:cucumber"].invoke
Rake::Task["rcov:rspec"].invoke
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment