-
Notifications
You must be signed in to change notification settings - Fork 1
/
.simplecov
55 lines (46 loc) · 1.07 KB
/
.simplecov
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
require 'simplecov-csv'
def isolation_mode?
ENV.fetch("ISOLATION_MODE",false)
end
def stats_mode?
ENV.fetch("STATS_MODE", false)
end
module SimpleCov::Formatter
class MutedHTMLFormatter < HTMLFormatter
def puts(*args)
end
end
class MutedCSVFormatter < CSVFormatter
def puts(*args)
end
end
class MutedMergedFormatter
def format(results)
[MutedHTMLFormatter, MutedCSVFormatter].each do |formatter|
formatter.new.format(results)
end
end
end
class MergedFormatter
def format(results)
[HTMLFormatter, CSVFormatter].each do |formatter|
formatter.new.format(results)
end
end
end
end
if isolation_mode?
SimpleCov.formatter = SimpleCov::Formatter::MutedCSVFormatter
SimpleCov.use_merging false
elsif stats_mode?
SimpleCov.formatter = SimpleCov::Formatter::MutedCSVFormatter
else
SimpleCov.formatter = SimpleCov::Formatter::MergedFormatter
end
SimpleCov.start do
add_filter 'bin/'
add_filter 'features/'
add_filter 'spec/'
add_group "Use Cases", "use_cases"
add_group "Entities", "lib"
end