covered 0.16.1 → 0.16.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/bake/covered/validate.rb +6 -4
- data/lib/covered/config.rb +19 -3
- data/lib/covered/minitest.rb +1 -1
- data/lib/covered/policy.rb +2 -2
- data/lib/covered/rspec.rb +1 -1
- data/lib/covered/source.rb +4 -3
- data/lib/covered/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80e616e80e33e55aa999b041dd1fa8c8bc4c6681bf3ed9634d058eb844693332
|
4
|
+
data.tar.gz: ee659443a9957432bb3a9f27d81cd302fb80780205282a9cf45796de57885b61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e7b2019674c223768d2cce4f7a24f5c654dcfaccf44a0ffc8909ab159eea9aa653db7367274f96aae02e41edd3e1d6fbeff66d3f022e7a177a04a11dfd66412
|
7
|
+
data.tar.gz: 11f142830471687a135d541b345fc423b385c940204c49db2d94f99a4cf575511cfa6738bc6db2f9bab23797d598a12145fe21d371b4f1b9a395382ec69087d9
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/bake/covered/validate.rb
CHANGED
@@ -2,23 +2,25 @@
|
|
2
2
|
def initialize(context)
|
3
3
|
super
|
4
4
|
|
5
|
-
require_relative '../../lib/covered/
|
5
|
+
require_relative '../../lib/covered/config'
|
6
6
|
end
|
7
7
|
|
8
8
|
# Validate the coverage of multiple test runs.
|
9
9
|
# @parameter paths [Array(String)] The coverage database paths.
|
10
10
|
# @parameter minumum [Float] The minimum required coverage in order to pass.
|
11
11
|
def validate(paths: nil, minimum: 1.0)
|
12
|
+
config = Covered::Config.load
|
13
|
+
|
12
14
|
paths&.each do |path|
|
13
15
|
# It would be nice to have a better algorithm here than just ignoring mtime - perhaps using checksums?
|
14
|
-
Covered::Persist.new(
|
16
|
+
Covered::Persist.new(config.output, path).load!(ignore_mtime: true)
|
15
17
|
end
|
16
18
|
|
17
|
-
|
19
|
+
config.flush
|
18
20
|
|
19
21
|
statistics = Covered::Statistics.new
|
20
22
|
|
21
|
-
|
23
|
+
config.each do |coverage|
|
22
24
|
statistics << coverage
|
23
25
|
end
|
24
26
|
|
data/lib/covered/config.rb
CHANGED
@@ -34,9 +34,11 @@ module Covered
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
def self.
|
38
|
-
|
39
|
-
|
37
|
+
def self.coverage
|
38
|
+
ENV['COVERAGE']
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.load(root: Dir.pwd, coverage: self.coverage)
|
40
42
|
derived = Class.new(self)
|
41
43
|
|
42
44
|
if path = self.path(root)
|
@@ -54,10 +56,20 @@ module Covered
|
|
54
56
|
@policy = nil
|
55
57
|
end
|
56
58
|
|
59
|
+
def record?
|
60
|
+
!!@coverage
|
61
|
+
end
|
62
|
+
|
63
|
+
attr :coverage
|
64
|
+
|
57
65
|
def policy
|
58
66
|
@policy ||= Policy.new.tap{|policy| make_policy(policy)}.freeze
|
59
67
|
end
|
60
68
|
|
69
|
+
def output
|
70
|
+
policy.output
|
71
|
+
end
|
72
|
+
|
61
73
|
def enable
|
62
74
|
policy.enable
|
63
75
|
end
|
@@ -74,6 +86,10 @@ module Covered
|
|
74
86
|
policy.call(output)
|
75
87
|
end
|
76
88
|
|
89
|
+
def each(&block)
|
90
|
+
policy.each(&block)
|
91
|
+
end
|
92
|
+
|
77
93
|
# Override this method to implement your own policy.
|
78
94
|
def make_policy(policy)
|
79
95
|
policy.cache!
|
data/lib/covered/minitest.rb
CHANGED
data/lib/covered/policy.rb
CHANGED
@@ -123,7 +123,7 @@ module Covered
|
|
123
123
|
end
|
124
124
|
|
125
125
|
def reports!(coverage)
|
126
|
-
if coverage
|
126
|
+
if coverage.is_a?(String)
|
127
127
|
names = coverage.split(',')
|
128
128
|
|
129
129
|
names.each do |name|
|
@@ -134,7 +134,7 @@ module Covered
|
|
134
134
|
@reports << Autoload.new(name)
|
135
135
|
end
|
136
136
|
end
|
137
|
-
|
137
|
+
elsif coverage
|
138
138
|
@reports << Covered::BriefSummary.new
|
139
139
|
end
|
140
140
|
end
|
data/lib/covered/rspec.rb
CHANGED
data/lib/covered/source.rb
CHANGED
data/lib/covered/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: covered
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -39,7 +39,7 @@ cert_chain:
|
|
39
39
|
RAOsIl+HOBTb252nx1kIRN5hqQx272AJCbCjKx8egcUQKffFVVCI0nye09v5CK+a
|
40
40
|
HiLJ8VOFx6w=
|
41
41
|
-----END CERTIFICATE-----
|
42
|
-
date: 2022-06-
|
42
|
+
date: 2022-06-15 00:00:00.000000000 Z
|
43
43
|
dependencies:
|
44
44
|
- !ruby/object:Gem::Dependency
|
45
45
|
name: async-rest
|
@@ -197,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
197
197
|
- !ruby/object:Gem::Version
|
198
198
|
version: '0'
|
199
199
|
requirements: []
|
200
|
-
rubygems_version: 3.
|
200
|
+
rubygems_version: 3.1.6
|
201
201
|
signing_key:
|
202
202
|
specification_version: 4
|
203
203
|
summary: A modern approach to code coverage.
|
metadata.gz.sig
CHANGED
Binary file
|