single_cov 1.7.0 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/single_cov/version.rb +1 -1
- data/lib/single_cov.rb +28 -3
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 191288dd953084f124ab1ad02620d9d0a4d0ed77aa24eaa4da49c96dbafae959
|
4
|
+
data.tar.gz: a286ebd56118b731cdfc3f67f7c35839b97a8e10e1514e801d04dd063a743a69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 216a68bd848bbf423383d2259c8841e192a20db71461bbb91a16b4d384cc7fb9fa4ffbe312b86ae25bc623f05b38c20f948b8eb4abb3e710ef42ec402b90c661
|
7
|
+
data.tar.gz: d8182e0a8e9b24c28b02c59c78200bec605e013818f6b47983303dbe8b62ed43ebfb6fe6a23ed50fa3bf9c7d0d501f2257197b2a8f258182db6849bef3e2b549
|
data/lib/single_cov/version.rb
CHANGED
data/lib/single_cov.rb
CHANGED
@@ -38,7 +38,7 @@ module SingleCov
|
|
38
38
|
|
39
39
|
# ignore lines that are marked as uncovered via comments
|
40
40
|
# TODO: warn when using uncovered but the section is indeed covered
|
41
|
-
content = File.readlines(file)
|
41
|
+
content = File.readlines("#{root}/#{file}")
|
42
42
|
uncovered.reject! do |line_start, _, _, _|
|
43
43
|
content[line_start - 1].match?(UNCOVERED_COMMENT_MARKER)
|
44
44
|
end
|
@@ -76,6 +76,32 @@ module SingleCov
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
+
def assert_full_coverage(tests: default_tests, currently_complete: [], location: nil)
|
80
|
+
location ||= caller(0..1)[1].split(':in').first
|
81
|
+
complete = tests.select { |file| File.read(file) =~ /SingleCov.covered!(\s*|\s*\#.*)$/ }
|
82
|
+
missing_complete = currently_complete - complete
|
83
|
+
newly_complete = complete - currently_complete
|
84
|
+
errors = []
|
85
|
+
|
86
|
+
if missing_complete.any?
|
87
|
+
errors << <<~MSG
|
88
|
+
The following file(s) were previously marked as having 100% SingleCov test coverage (had no `coverage:` option) but are no longer marked as such.
|
89
|
+
Please increase test coverage in these files to maintain 100% coverage and remove `coverage:` usage.
|
90
|
+
#{missing_complete.join("\n")}
|
91
|
+
MSG
|
92
|
+
end
|
93
|
+
|
94
|
+
if newly_complete.any?
|
95
|
+
errors << <<~MSG
|
96
|
+
The following files are newly at 100% SingleCov test coverage.
|
97
|
+
Please add the following to #{location} to ensure 100% coverage is maintained moving forward.
|
98
|
+
#{newly_complete.join("\n")}
|
99
|
+
MSG
|
100
|
+
end
|
101
|
+
|
102
|
+
raise errors.join("\n") if errors.any?
|
103
|
+
end
|
104
|
+
|
79
105
|
def setup(framework, root: nil, branches: true, err: $stderr)
|
80
106
|
@error_logger = err
|
81
107
|
|
@@ -273,9 +299,8 @@ module SingleCov
|
|
273
299
|
end
|
274
300
|
|
275
301
|
def ensure_covered_file(file)
|
276
|
-
raise "Use paths relative to project root." if file&.start_with?("/")
|
277
|
-
|
278
302
|
if file
|
303
|
+
raise "Use paths relative to project root." if file.start_with?("/")
|
279
304
|
raise "#{file} does not exist, use paths relative to project root." unless File.exist?("#{root}/#{file}")
|
280
305
|
else
|
281
306
|
file = guess_covered_file(caller[1])
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: single_cov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
13
|
+
description:
|
14
14
|
email: michael@grosser.it
|
15
15
|
executables: []
|
16
16
|
extensions: []
|
@@ -23,7 +23,7 @@ homepage: https://github.com/grosser/single_cov
|
|
23
23
|
licenses:
|
24
24
|
- MIT
|
25
25
|
metadata: {}
|
26
|
-
post_install_message:
|
26
|
+
post_install_message:
|
27
27
|
rdoc_options: []
|
28
28
|
require_paths:
|
29
29
|
- lib
|
@@ -31,15 +31,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
31
31
|
requirements:
|
32
32
|
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 2.
|
34
|
+
version: 2.7.0
|
35
35
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '0'
|
40
40
|
requirements: []
|
41
|
-
rubygems_version: 3.
|
42
|
-
signing_key:
|
41
|
+
rubygems_version: 3.3.3
|
42
|
+
signing_key:
|
43
43
|
specification_version: 4
|
44
44
|
summary: Actionable code coverage.
|
45
45
|
test_files: []
|