Sha256: 6e89076045a872167ab0132b1c60ac3b17d61f39b3d55d35f312bf1b8120e4be

Contents?: true

Size: 1.13 KB

Versions: 2

Compression:

Stored size: 1.13 KB

Contents

require 'spec/rake/verify_rcov'

namespace :spec do
  Spec::Rake::SpecTask.new(:rcov) do |t|
    t.spec_files = FileList['spec/**/*_spec.rb']
    t.spec_opts = ['--color', '--format', 'specdoc']
    t.rcov = true
    t.rcov_opts = [
      '--exclude', 'spec',
      '--exclude', '1\\.8\\/gems',
      '--exclude', '1\\.9\\/gems'
    ]
  end

  RCov::VerifyTask.new(:verify) do |t| 
    t.threshold = 100.0
    t.index_html = 'coverage/index.html'
  end

  task :verify => :rcov

  desc "Generate HTML Specdocs for all specs"
  Spec::Rake::SpecTask.new(:specdoc) do |t|
    specdoc_path = File.expand_path(
      File.join(File.dirname(__FILE__), '../specdoc/'))
    Dir.mkdir(specdoc_path) if !File.exist?(specdoc_path)
    
    output_file = File.join(specdoc_path, 'index.html')
    t.spec_files = FileList['spec/**/*_spec.rb']
    t.spec_opts = ["--format", "\"html:#{output_file}\"", "--diff"]
    t.fail_on_error = false
  end  

  desc "Browse the code coverage report."
  task :rcov_browse => :rcov do
    Rake.browse("coverage/index.html")
  end
end

desc "Alias to spec:verify"
task "spec" => "spec:verify"

task "clobber" => ["spec:clobber_rcov"]

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
instrument-0.1.0 tasks/spec.rake
instrument-0.1.1 tasks/spec.rake