-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
41 lines (36 loc) · 1 KB
/
Rakefile
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
require 'rubygems'
require 'rspec/core/rake_task'
require 'cucumber/rake/task'
namespace :rcov do
desc "Run RSpec tests with coverage analysis"
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = 'spec/**/*_spec.rb'
t.rspec_opts = ['--color', '--format doc']
t.rcov = true
t.rcov_opts = [
'--exclude /.gem/,/gems/,spec,features',
'--include lib/**/*.rb',
'--aggregate coverage.data',
]
end
desc "Run Cucumber tests with coverage analysis"
Cucumber::Rake::Task.new(:cucumber) do |t|
t.cucumber_opts = [
"--format pretty",
"--tags ~@wip",
]
t.rcov = true
t.rcov_opts = [
'--exclude /.gem/,/gems/,spec,features',
'--include lib/**/*.rb',
'--aggregate coverage.data',
]
end
desc "Run RSpec and Cucumber tests with coverage analysis"
task :all do |t|
rm 'coverage.data' if File.exist?('coverage.data')
Rake::Task['rcov:spec'].invoke
Rake::Task['rcov:cucumber'].invoke
end
end
task :default => ['rcov:all']