single_cov 1.0.1 → 1.0.2
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 +13 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11ef65dfb536bd0a3194ea9668ac96975723fece04a0c4561c61c42a799427a3
|
4
|
+
data.tar.gz: 15ac6753da7ff1b3f5a330c25660c1dcb9fb9fec17a8aaed2126e732f68977de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0f909a8774964b6d651f95e57aab1fec5fed9462a2e12ab932b9c1d43d249276b5ea5e79770b2ef3ab7eb3143dc067b463f5bfae1a0bdae88a5630b4c19dce6
|
7
|
+
data.tar.gz: 6ecfeee0f58db257fd44f25a0606c8ef0d0064a0eadf024aee912836b599ec413d304846d026d84d6a8e97fcedb0db85bfd86b65f36622abc509e69c4d43e9eb
|
data/lib/single_cov/version.rb
CHANGED
data/lib/single_cov.rb
CHANGED
@@ -22,15 +22,22 @@ module SingleCov
|
|
22
22
|
errors = COVERAGES.map do |file, expected_uncovered|
|
23
23
|
if coverage = result["#{root}/#{file}"]
|
24
24
|
line_coverage = (coverage.is_a?(Hash) ? coverage.fetch(:lines) : coverage)
|
25
|
-
|
25
|
+
uncovered = line_coverage.each_with_index.map { |c, i| i + 1 if c == 0 }.compact
|
26
|
+
branch_coverage = (coverage.is_a?(Hash) && coverage[:branches])
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
if branch_coverage = (coverage.is_a?(Hash) && coverage[:branches])
|
30
|
-
uncovered += uncovered_branches(file, branch_coverage, uncovered_lines)
|
28
|
+
if branch_coverage
|
29
|
+
uncovered.concat uncovered_branches(file, branch_coverage, uncovered)
|
31
30
|
end
|
32
31
|
|
33
32
|
next if uncovered.size == expected_uncovered
|
33
|
+
|
34
|
+
# branches are unsorted and added to the end, only sort when necessary
|
35
|
+
uncovered.sort! if branch_coverage
|
36
|
+
|
37
|
+
uncovered.map! do |line_start, char_start, line_end, char_end|
|
38
|
+
char_start ? "#{file}:#{line_start}:#{char_start}-#{line_end}:#{char_end}" : "#{file}:#{line_start}"
|
39
|
+
end
|
40
|
+
|
34
41
|
warn_about_bad_coverage(file, expected_uncovered, uncovered)
|
35
42
|
else
|
36
43
|
warn_about_no_coverage(file)
|
@@ -113,8 +120,7 @@ module SingleCov
|
|
113
120
|
|
114
121
|
# show missing coverage
|
115
122
|
found = sum.select { |k, v| v.zero? && !uncovered_lines.include?(k[0]) }.
|
116
|
-
map { |k, _|
|
117
|
-
found.sort!
|
123
|
+
map { |k, _| [k[0], k[1]+1, k[2], k[3]+1] }
|
118
124
|
found.uniq!
|
119
125
|
found
|
120
126
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: single_cov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: michael@grosser.it
|
@@ -39,7 +39,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
39
39
|
version: '0'
|
40
40
|
requirements: []
|
41
41
|
rubyforge_project:
|
42
|
-
rubygems_version: 2.7.
|
42
|
+
rubygems_version: 2.7.6
|
43
43
|
signing_key:
|
44
44
|
specification_version: 4
|
45
45
|
summary: Actionable code coverage.
|