simplecov-rspec 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +17 -0
- data/README.md +1 -1
- data/lib/simplecov-rspec/version.rb +1 -1
- data/lib/simplecov-rspec.rb +49 -13
- metadata +26 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 862cb86ed8d8fab68c4634038cd69abedf062c091da28dfbf58505ef1063d4dc
|
4
|
+
data.tar.gz: a05ec0c099ccb49a93a338d28b34766740d1fbbd0fe6d2b7bf53f3037f506da7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4d675d09258f5803030dd292da7bc89dfee3c8ba1dc3b0380470230dc02c495cfaaaac5473cba5bfcc29de665d9de2e3dbe123697ec3cde338caf1ddd5223ae
|
7
|
+
data.tar.gz: e25a543369fc68e01a7cc7ba43d43c15b387e0339237e9bc8f01f2d5fd527f030616ca5a9494a6142e36c7104804c17cc41dcc740b78edc8e69453e8862f7d4b
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,23 @@ Changes for each release are listed in this file.
|
|
4
4
|
|
5
5
|
This project adheres to [Semantic Versioning](https://semver.org/) for its releases.
|
6
6
|
|
7
|
+
## v0.3.0 (2024-09-14)
|
8
|
+
|
9
|
+
[Full Changelog](https://github.com/main-branch/simplecov-rspec/compare/v0.2.1..v0.3.0)
|
10
|
+
|
11
|
+
Changes since v0.2.1:
|
12
|
+
|
13
|
+
* 55c3812 Output the number of lines missing coverage
|
14
|
+
* 9356f64 Rename variables from "lines_not_covered" to "uncovered_lines" to be consistent
|
15
|
+
* ec637c0 Fix error in README
|
16
|
+
* 9d9cb0c Rearrange workflow definitions to have the name first
|
17
|
+
* ac8efae Update continuous integration and experimental ruby builds
|
18
|
+
* ac1da92 Use v1 tag for the semver_pr_label_check workflow
|
19
|
+
* d701393 Auto-correct new Rubocop offenses
|
20
|
+
* 0319f68 Update minimal Ruby version to 3.1
|
21
|
+
* d6b57d1 Update code climate test coverage reporter version to v9
|
22
|
+
* 02553a1 Change simplecov from a development dependency to a runtime dependency
|
23
|
+
|
7
24
|
## v0.2.1 (2024-09-10)
|
8
25
|
|
9
26
|
[Full Changelog](https://github.com/main-branch/simplecov-rspec/compare/v0.2.0..v0.2.1)
|
data/README.md
CHANGED
data/lib/simplecov-rspec.rb
CHANGED
@@ -286,11 +286,11 @@ module SimpleCov
|
|
286
286
|
# @private
|
287
287
|
def output_at_exit_report
|
288
288
|
low_coverage_report if show_low_coverage_report?
|
289
|
-
|
290
|
-
$stderr.puts if show_low_coverage_report? ||
|
289
|
+
uncovered_lines_report if show_uncovered_lines_report?
|
290
|
+
$stderr.puts if show_low_coverage_report? || show_uncovered_lines_report?
|
291
291
|
end
|
292
292
|
|
293
|
-
# Whether to show the low coverage
|
293
|
+
# Whether to show the low coverage
|
294
294
|
# @return [Boolean]
|
295
295
|
# @api private
|
296
296
|
# @private
|
@@ -302,7 +302,7 @@ module SimpleCov
|
|
302
302
|
# @private
|
303
303
|
def coverage_below_threshold? = simplecov_module.result.covered_percent < coverage_threshold
|
304
304
|
|
305
|
-
# Output the low coverage
|
305
|
+
# Output the low coverage report
|
306
306
|
# @return [Void]
|
307
307
|
# @api private
|
308
308
|
# @private
|
@@ -317,23 +317,59 @@ module SimpleCov
|
|
317
317
|
# @api private
|
318
318
|
def uncovered_lines_found? = simplecov_module.result.files.any? { |source_file| source_file.missed_lines.any? }
|
319
319
|
|
320
|
-
# Whether to show
|
320
|
+
# Whether to show the uncovered lines
|
321
321
|
# @return [Boolean]
|
322
322
|
# @api private
|
323
323
|
# @private
|
324
|
-
def
|
324
|
+
def show_uncovered_lines_report? = list_uncovered_lines? && uncovered_lines_found?
|
325
325
|
|
326
|
-
#
|
326
|
+
# An uncovered line
|
327
|
+
#
|
328
|
+
# @!attribute project_filename [rw]
|
329
|
+
# The path to the file with uncovered lines relative to the project root
|
330
|
+
# @return [String]
|
331
|
+
# @api private
|
332
|
+
#
|
333
|
+
# @!attribute line_number [rw]
|
334
|
+
# The line number of the uncovered line
|
335
|
+
# @return [Integer]
|
336
|
+
# @api private
|
337
|
+
#
|
338
|
+
# @api private
|
339
|
+
UncoveredLine = Struct.new(:project_filename, :line_number)
|
340
|
+
|
341
|
+
# Return the uncovered lines from the SimpleCov result
|
342
|
+
# @return [Array<UncoveredLine>]
|
343
|
+
# @api private
|
344
|
+
def uncovered_lines
|
345
|
+
@uncovered_lines ||=
|
346
|
+
simplecov_module.result.files.flat_map do |source_file|
|
347
|
+
source_file.missed_lines.map do |line|
|
348
|
+
project_filename = File.join('.', source_file.project_filename)
|
349
|
+
UncoveredLine.new(project_filename, line.number)
|
350
|
+
end
|
351
|
+
end
|
352
|
+
end
|
353
|
+
|
354
|
+
# Return the singular or plural form of a word based on the count
|
355
|
+
# @param count [Integer] the count
|
356
|
+
# @param singular [String] the singular form of the phrase
|
357
|
+
# @param plural [String] the plural form of the phrase
|
358
|
+
# @return [String]
|
359
|
+
# @api private
|
360
|
+
def pluralize(count, singular, plural) = count == 1 ? singular : plural
|
361
|
+
|
362
|
+
# Output the uncovered lines
|
327
363
|
# @return [Void]
|
328
364
|
# @api private
|
329
365
|
# @private
|
330
|
-
def
|
366
|
+
def uncovered_lines_report
|
331
367
|
$stderr.puts
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
368
|
+
count = uncovered_lines.count
|
369
|
+
things = pluralize(uncovered_lines.count, 'line is', 'lines are')
|
370
|
+
$stderr.puts "#{count} #{things} not covered by tests:\n"
|
371
|
+
uncovered_lines.each do |uncovered_line|
|
372
|
+
$stderr.puts " #{uncovered_line.project_filename}:#{uncovered_line.line_number}"
|
337
373
|
end
|
338
374
|
end
|
339
375
|
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplecov-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Couball
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: simplecov
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.22'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.22'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler-audit
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -30,14 +44,14 @@ dependencies:
|
|
30
44
|
requirements:
|
31
45
|
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
47
|
+
version: '1.5'
|
34
48
|
type: :development
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
54
|
+
version: '1.5'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: fuubar
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,28 +100,14 @@ dependencies:
|
|
86
100
|
requirements:
|
87
101
|
- - "~>"
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version: '1.
|
103
|
+
version: '1.66'
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
108
|
- - "~>"
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version: '1.
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: simplecov
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0.22'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0.22'
|
110
|
+
version: '1.66'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: simplecov-lcov
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -209,8 +209,8 @@ licenses:
|
|
209
209
|
metadata:
|
210
210
|
allowed_push_host: https://rubygems.org
|
211
211
|
homepage_uri: https://github.com/main-branch/simplecov-rspec
|
212
|
-
changelog_uri: https://rubydoc.info/gems/simplecov-rspec/0.
|
213
|
-
documentation_uri: https://rubydoc.info/gems/simplecov-rspec/0.
|
212
|
+
changelog_uri: https://rubydoc.info/gems/simplecov-rspec/0.3.0/file/CHANGELOG.md
|
213
|
+
documentation_uri: https://rubydoc.info/gems/simplecov-rspec/0.3.0
|
214
214
|
rubygems_mfa_required: 'true'
|
215
215
|
post_install_message:
|
216
216
|
rdoc_options: []
|
@@ -220,13 +220,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
220
220
|
requirements:
|
221
221
|
- - ">="
|
222
222
|
- !ruby/object:Gem::Version
|
223
|
-
version: 3.
|
223
|
+
version: 3.1.0
|
224
224
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
225
225
|
requirements:
|
226
226
|
- - ">="
|
227
227
|
- !ruby/object:Gem::Version
|
228
228
|
version: '0'
|
229
|
-
requirements:
|
229
|
+
requirements:
|
230
|
+
- 'Platform: Mac, Linux, or Windows'
|
231
|
+
- 'Ruby: MRI 3.1 or later, TruffleRuby 24 or later, or JRuby 9.4 or later'
|
230
232
|
rubygems_version: 3.5.16
|
231
233
|
signing_key:
|
232
234
|
specification_version: 4
|