Sha256: 466a2f2fc7ab731f00833d07b1e34c8752d19b0879993f63820bbfbce2159c77

Contents?: true

Size: 1.23 KB

Versions: 14

Compression:

Stored size: 1.23 KB

Contents

# Forked to get it working with Rails 3 and RSpec 2
#
# From http://github.com/jaymcgavren
#
# Save this as rcov.rake in lib/tasks and use rcov:all =>
# to get accurate spec/feature coverage data
#
# Use rcov:rspec or rcov:cucumber
# to get non-aggregated coverage reports for rspec or cucumber separately

require 'cucumber/rake/task'
require "rspec/core/rake_task"

namespace :rcov do
  Cucumber::Rake::Task.new(:cucumber_run) 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

  RSpec::Core::RakeTask.new(:rspec_run) do |t|
    t.pattern = 'spec/**/*_spec.rb'
    t.rcov = true
    t.rcov_opts = %w{--rails --exclude osx\/objc,gems\/,spec\/}
  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_run"].invoke
    Rake::Task["rcov:rspec_run"].invoke
  end

  desc "Run only rspecs"
  task :rspec do |t|
    rm "coverage.data" if File.exist?("coverage.data")
    Rake::Task["rcov:rspec_run"].invoke
  end

  desc "Run only cucumber"
  task :cucumber do |t|
    Rake::Task["rcov:cucumber_run"].invoke
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
editorial_logic-1.4.1 lib/tasks/rcov.rake
editorial_logic-1.4.0 lib/tasks/rcov.rake
editorial_logic-1.3.3 lib/tasks/rcov.rake
editorial_logic-1.3.2 lib/tasks/rcov.rake
editorial_logic-1.3.1 lib/tasks/rcov.rake
editorial_logic-1.3.0 lib/tasks/rcov.rake
editorial_logic-1.1.6 lib/tasks/rcov.rake
editorial_logic-1.1.5 lib/tasks/rcov.rake
editorial_logic-1.1.4 lib/tasks/rcov.rake
editorial_logic-1.1.3 lib/tasks/rcov.rake
editorial_logic-1.1.2 lib/tasks/rcov.rake
mitamirri-2.0.8 lib/tasks/rcov.rake
editorial_logic-1.1.1 lib/tasks/rcov.rake
editorial_logic-1.1.0 lib/tasks/rcov.rake