summaryrefslogtreecommitdiffstats
path: root/tasks/spec.rake
blob: 48df989f6fe186bcaa3f00bdc66f85652422be39 (plain)
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
# -*- coding: UTF-8 -*-
#
#if HAVE_SPEC_RAKE_SPECTASK and not PROJ.spec.files.to_a.empty?
require 'rspec/core/rake_task'
#
namespace :spec do

    desc 'Run all specs with basic output'
    RSpec::Core::RakeTask.new(:run) do |t|
        t.ruby_opts = PROJ.ruby_opts
        t.rspec_opts = PROJ.spec.opts
    end

    desc 'Run all specs with text output'
    RSpec::Core::RakeTask.new(:doc) do |t|
        t.ruby_opts = PROJ.ruby_opts
        t.rspec_opts = PROJ.spec.opts + ['-fs' ]
    end

    desc 'Run all specs with html output'
    RSpec::Core::RakeTask.new(:html) do |t|
        t.ruby_opts = PROJ.ruby_opts
        t.rspec_opts = PROJ.spec.opts + ['-fh' ]
    end

    if HAVE_RCOV
        desc 'Run all specs with RCov'
        RSpec::Core::RakeTask.new(:rcov) do |t|
            t.ruby_opts = PROJ.ruby_opts
            t.rspec_opts = PROJ.spec.opts
            t.rcov = true
            t.rcov_opts = PROJ.rcov.opts + ['--exclude', 'spec']
        end
    end

end  # namespace :spec

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

# EOF