Search code examples
rspeccucumbercode-coverage

Aggregate cover_me results for rspec and cucumber


Before moving over to ruby 1.9.2 and cover_me I was using rcov. We don't tend to unit test controllers, relying instead on cucumber coverage. With rcov it was possible to aggregate the coverage results from both the cucumber and rspec runs. Is this possible with cover_me?


Solution

  • Here's the Rakefile that I ended up with, you can get coverage for rspec, cucumber or both combined:

    namespace :cover_me do
      task :report do
        require 'cover_me'
        CoverMe.complete!
      end
    
      task :all => %w{ rake:spec rake:cucumber report }
      task :spec => %w{ rake:spec report }
      task :cucumber => %w{ rake:cucumber report }
    end