Sha256: 05fad268bdde37bef04cbccaaf1bc730214fa3b8f103e42cbbc625812c6321c8

Contents?: true

Size: 1.47 KB

Versions: 5

Compression:

Stored size: 1.47 KB

Contents

if HAVE_SPEC_RAKE_SPECTASK and not PROJ.spec.files.to_a.empty?
require 'spec/rake/verify_rcov'

namespace :spec do

  desc 'Run all specs with basic output'
  Spec::Rake::SpecTask.new(:run) do |t|
    # Allow user to specify specs to run at command line
    _, spec_files = ARGV
    spec_files ||= PROJ.spec.files
    t.verbose = true

    t.ruby_opts = PROJ.ruby_opts
    t.spec_opts = PROJ.spec.opts
    t.spec_files = spec_files
    t.libs += PROJ.libs
  end

  desc 'Run all specs with text output'
  Spec::Rake::SpecTask.new(:specdoc) do |t|
    t.ruby_opts = PROJ.ruby_opts
    t.spec_opts = PROJ.spec.opts + ['--format', 'specdoc']
    t.spec_files = PROJ.spec.files
    t.libs += PROJ.libs
  end

  if HAVE_RCOV
    desc 'Run all specs with RCov'
    Spec::Rake::SpecTask.new(:rcov) do |t|
      t.ruby_opts = PROJ.ruby_opts
      t.spec_opts = PROJ.spec.opts
      t.spec_files = PROJ.spec.files
      t.libs += PROJ.libs
      t.rcov = true
      t.rcov_dir = PROJ.rcov.dir
      t.rcov_opts = PROJ.rcov.opts + ['--exclude', 'spec']
    end

    RCov::VerifyTask.new(:verify) do |t|
      t.threshold = PROJ.rcov.threshold
      t.index_html = File.join(PROJ.rcov.dir, 'index.html')
      t.require_exact_threshold = PROJ.rcov.threshold_exact
    end

    task :verify => :rcov
    remove_desc_for_task %w(spec:clobber_rcov)
  end

end  # namespace :spec

desc 'Alias to spec:run'
task :spec => 'spec:run'

task :clobber => 'spec:clobber_rcov' if HAVE_RCOV

end  # if HAVE_SPEC_RAKE_SPECTASK

# EOF

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cascading.jruby-0.0.9 tasks/spec.rake
cascading.jruby-0.0.8 tasks/spec.rake
cascading.jruby-0.0.7 tasks/spec.rake
cascading.jruby-0.0.6 tasks/spec.rake
cascading.jruby-0.0.5 tasks/spec.rake