Sha256: 11fef224ee9e037f22c2a9cd918c4ebbc5e8f51a4ff123cc9f608484b22d8bec

Contents?: true

Size: 1.04 KB

Versions: 7

Compression:

Stored size: 1.04 KB

Contents

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

desc "Run the specs under spec/"
Spec::Rake::SpecTask.new do |t|
  t.spec_opts = ['--options', "spec/spec.opts"]
  t.spec_files = FileList['spec/**/*_spec.rb']
end

desc "Run the specs under spec/ with rcov enabled"
Spec::Rake::SpecTask.new 'rcov' do |t|
  t.spec_opts = ['--options', "spec/spec.opts"]
  t.spec_files = FileList['spec/**/*_spec.rb']
  t.rcov = true
  t.rcov_opts = ['--exclude', 'spec']
end

desc "Generate HTML report for rspec examples"
Spec::Rake::SpecTask.new('spec_report') do |t|
  t.spec_opts = ["--format", "html:../doc/rspec/specs.html", "--diff"]
  t.spec_files = FileList['spec/**/*_spec.rb']
  t.fail_on_error = false
end

# credits to http://blog.jayfields.com/2008/02/rake-task-overwriting.html
class Rake::Task
  def overwrite(&block)
    @actions.clear
    prerequisites.clear
    enhance(&block)
  end
end

Rake::Task['test'].overwrite do
  Rake::Task['spec'].invoke
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
mikewadhera-jetty-rails-0.9.1 tasks/rspec.rake
mikewadhera-jetty-rails-0.9.2 tasks/rspec.rake
mikewadhera-jetty-rails-0.9.3 tasks/rspec.rake
mikewadhera-jetty-rails-0.9 tasks/rspec.rake
jetty-rails-0.6 tasks/rspec.rake
jetty-rails-0.8 tasks/rspec.rake
jetty-rails-0.7 tasks/rspec.rake