Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 48 lines (37 sloc) 0.918 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
require 'bundler/gem_tasks'
require 'rake'
require 'rspec/core/rake_task'

RCOV = RUBY_VERSION.to_f == 1.8

namespace :spec do

  RSpec::Core::RakeTask.new(:coverage) do |t|
    t.pattern = 'spec/**/*_spec.rb'

    if RCOV
      t.rcov = true
      t.rcov_opts = '--exclude osx\/objc,spec,gems\/'
    end
  end

  RSpec::Core::RakeTask.new(:normal) do |t|
    t.pattern ='spec/**/*_spec.rb'
    t.rcov = false
  end

  namespace :coverage do
    desc "Cleanup coverage data"
    task :cleanup do
      rm_rf 'coverage.data'
      rm_rf 'coverage'
    end

    desc "Browse the code coverage report."
    task :report => ["spec:coverage:cleanup", "spec:coverage"] do
      if RCOV
        require "launchy"
        Launchy.open("coverage/index.html")
      else
        require 'cover_me'
        CoverMe.complete!
      end
    end
  end

end

desc "RSpec tests"
task "spec" => "spec:normal"

task "default" => "spec"
Something went wrong with that request. Please try again.