File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -22,12 +22,19 @@ def self.start(*arguments, **options)
22
22
Truffle ::Coverage . enable
23
23
end
24
24
25
- def self . result
25
+ def self . result ( stop : true , clear : true )
26
26
result = peek_result
27
- Truffle ::Coverage . disable
27
+ Truffle ::Coverage . disable if stop || clear
28
+ Truffle ::Coverage . enable if !stop && clear
28
29
# We have to wrap the coverage lines array in a hash with the :lines key if
29
30
# the :lines option was given
30
- result . transform_values! { |_ , lines_array | { lines : lines_array } } if @lines
31
+ if @lines
32
+ result . transform_values! do |_ , *lines_array |
33
+ # need to add nil to the beginning of each lines array, because the
34
+ # first line has index 1 and not 0
35
+ { lines : lines_array . unshift ( nil ) }
36
+ end
37
+ end
31
38
result
32
39
end
33
40
You can’t perform that action at this time.
0 commit comments