Sha256: 15961f5d9a7b5d0607fdf46378af08684fcc22c9cae1bdce7b8dca45f8855509

Contents?: true

Size: 891 Bytes

Versions: 5

Compression:

Stored size: 891 Bytes

Contents

require 'rake/clean'

begin
  require 'spec'
rescue LoadError
  require 'rubygems'
  require 'spec'
end
begin
  require 'spec/rake/spectask'
  require 'spec/rake/verify_rcov'
rescue LoadError
  puts <<-EOS
To use rspec for testing you must install rspec gem:
    gem install rspec
EOS
  exit(0)
end

REPORT_DIR = 'spec/output/coverage'
CLEAN.include(REPORT_DIR)

desc "runs the specs"
Spec::Rake::SpecTask.new(:spec) do |t|
  t.spec_files = FileList['spec/**/*_spec.rb']
end

desc "runs the specs and reports coverage in #{REPORT_DIR}"
Spec::Rake::SpecTask.new(:spec_rcov) do |t|
  t.spec_files = FileList['spec/**/*_spec.rb']
  t.rcov = true
  t.rcov_dir = REPORT_DIR
  t.rcov_opts = ['--exclude', 'spec,\.autotest']
end

desc "runs the specs and checks for 100% coverage"
RCov::VerifyTask.new(:rcov => :spec_rcov) do |t|
  t.index_html = "#{REPORT_DIR}/index.html"
  t.threshold = 100
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
reek-0.2.3 tasks/rspec.rake
reek-0.2.1 tasks/rspec.rake
reek-0.2.2 tasks/rspec.rake
reek-0.3.0 tasks/rspec.rake
reek-0.3.1 tasks/rspec.rake