Skip to content

Instantly share code, notes, and snippets.

@dpickett
Created April 26, 2011 14:14
Show Gist options
  • Select an option

  • Save dpickett/942323 to your computer and use it in GitHub Desktop.

Select an option

Save dpickett/942323 to your computer and use it in GitHub Desktop.
begin
require "rcov"
namespace :rcov do
Cucumber::Rake::Task.new(:cucumber) do |t|
t.rcov = true
t.rcov_opts = %w{--rails --exclude osx\/objc,gems\/,spec\/,features\/ --aggregate coverage.data}
t.rcov_opts << %[-o "coverage"]
end
desc "Run all specs with rcov"
RSpec::Core::RakeTask.new(:rspec) do |t|
t.rcov = true
t.rcov_opts = %w{--rails --exclude osx\/objc,gems\/,spec\/,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
rescue LoadError
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment