-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathRakefile
86 lines (70 loc) · 1.97 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
require 'cucumber/rake/task'
module Cucover
module Rake
class Task < Cucumber::Rake::Task
def feature_pattern=(value)
@feature_pattern = value
end
def pretty!
@format = 'pretty'
end
def tags=(value)
@tags = value
end
private
def feature_pattern
@feature_pattern || 'features/**/*.feature'
end
def feature_files(task_arguments = nil)
FileList[feature_pattern]
end
def formatters
[
'-f', 'rerun', '-o', 'rerun',
'-f', @format || 'progress',
]
end
def tags
return [] unless @tags
[ '-t', @tags ]
end
def cucumber_opts
formatters + tags
end
end
end
end
def rerun
return nil unless File.exist?('rerun')
result = File.read('rerun').strip
return nil if result.empty?
result
end
Cucover::Rake::Task.new(:default) do |t|
t.tags = '~in-progress'
end
Cucover::Rake::Task.new(:all)
Cucover::Rake::Task.new(:failed) do |t|
t.pretty!
t.feature_pattern = rerun if rerun
end
Cucumber::Rake::Task.new(:coverage) do |t|
t.rcov = true
t.rcov_opts = %w{--exclude osx\/objc,gems\/,spec\/}
end
begin
require 'jeweler'
Jeweler::Tasks.new do |gemspec|
gemspec.name = "cucover"
gemspec.summary = "Lazy coverage-aware running of Cucumber acceptance tests"
gemspec.email = "matt@mattwynne.net"
gemspec.homepage = "http://github.com/mattwynne/cucover/"
gemspec.description = "Lazy coverage-aware running of Cucumber acceptance tests"
gemspec.authors = ["Matt Wynne", "Joseph Wilk"]
gemspec.add_dependency('cucumber', '>= 0.6.4')
gemspec.add_dependency('rcov', '>= 0.9.8')
gemspec.add_dependency('logging', '>= 1.4.1')
end
rescue LoadError
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
end