covered 0.16.0 → 0.16.3
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 +3 -4
- data/bake/covered/validate.rb +6 -4
- data/lib/covered/cache.rb +1 -1
- 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 +22 -2
- 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: b3ec9e58976df4dd7611cd55dd8f7c3e21267147453e1ea6be3339a8bfc98d6f
|
4
|
+
data.tar.gz: 7ff2d500f8b308186f1db4609c5b1f14594ead77b77c77df54efc5953586a6e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e835b21f824253f8aef9aa500f01d7a0d4235cdb17f5799858d6e66deb2afe3970e63a4761c1c0f9d97cf2522e56ead2226103e12cc87a6a6b2079add132ffcb
|
7
|
+
data.tar.gz: e81491a1f50577050c58cdc0ae11e0b230097456d71ac544c640a977927a685aa7844ef24c886385c7ab6aa1f490182c7963c0833776655c71c06b583c3ac322
|
checksums.yaml.gz.sig
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
b1y��<�I�C�8�IF�؍�'��n�F�
|
1
|
+
�Tz���-捈��إ�GgG�'�������������ØD����6�/�H ����\m^�|�MEkH�e[�����B���)��t~�]y;\�C�Q����;l�.������EII���87c��o�z�C��r���
|
2
|
+
��ʜ��к��|l�G�W�Z�ꖠB����1�!��˛��/|�h�Q�aI������P̳��L�
|
3
|
+
^јwg���SMO/�jm��CWܚ�vT$B�VO����t�?�[�ܡ���
|
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/cache.rb
CHANGED
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
@@ -68,12 +68,32 @@ module Covered
|
|
68
68
|
|
69
69
|
attr :paths
|
70
70
|
|
71
|
+
EXECUTABLE = {
|
72
|
+
send: true,
|
73
|
+
yield: true,
|
74
|
+
# Line trace point is not triggered for return statements.
|
75
|
+
# return: true,
|
76
|
+
def: true,
|
77
|
+
if: true,
|
78
|
+
lvasgn: true,
|
79
|
+
ivasgn: true,
|
80
|
+
cvasgn: true,
|
81
|
+
gvasgn: true,
|
82
|
+
match_pattern: true
|
83
|
+
}
|
84
|
+
|
71
85
|
def executable?(node)
|
72
|
-
node.type
|
86
|
+
EXECUTABLE[node.type]
|
73
87
|
end
|
74
88
|
|
89
|
+
IGNORE = {
|
90
|
+
arg: true,
|
91
|
+
# Ruby doesn't appear to execute rescue lines.
|
92
|
+
rescue: true
|
93
|
+
}
|
94
|
+
|
75
95
|
def ignore?(node)
|
76
|
-
node.nil?
|
96
|
+
node.nil? || IGNORE[node.type]
|
77
97
|
end
|
78
98
|
|
79
99
|
def expand(node, coverage, level = 0)
|
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.3
|
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
|