covered 0.26.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/bake/covered/debug.rb +2 -2
- data/bake/covered/policy.rb +2 -2
- data/bake/covered/validate.rb +2 -2
- data/context/configuration.md +355 -0
- data/context/getting-started.md +66 -0
- data/context/index.yaml +17 -0
- data/context/usage.md +110 -0
- data/lib/covered/autostart.rb +2 -2
- data/lib/covered/brief_summary.rb +35 -0
- data/lib/covered/capture.rb +3 -3
- data/lib/covered/config.rb +12 -12
- data/lib/covered/coverage.rb +2 -2
- data/lib/covered/files.rb +4 -4
- data/lib/covered/forks.rb +2 -2
- data/lib/covered/markdown_summary.rb +5 -5
- data/lib/covered/minitest.rb +3 -3
- data/lib/covered/partial_summary.rb +85 -0
- data/lib/covered/persist.rb +4 -4
- data/lib/covered/policy.rb +3 -3
- data/lib/covered/rspec.rb +4 -4
- data/lib/covered/statistics.rb +3 -3
- data/lib/covered/summary.rb +4 -64
- data/lib/covered/sus.rb +3 -3
- data/lib/covered/version.rb +2 -2
- data/lib/covered.rb +4 -1
- data/license.md +2 -1
- data/readme.md +20 -8
- data/releases.md +9 -0
- data.tar.gz.sig +0 -0
- metadata +15 -12
- 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: 289a32298170797803df03aec0f13ab6452bcc2787d38e85860ead1bca0b17b0
|
4
|
+
data.tar.gz: 6f682d81566f970a93a4aed6b00e1db77603fcf2a982245e75c60e7c30f15652
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4495fe21349a2cd25fbfc81e7de1b0d2c00465635f543b991cb8f740e8dad98653dd7a59552e065fb51a5224e39ce12601199ca912fde16033eb43b109f1197d
|
7
|
+
data.tar.gz: e43586380b8587f803c1175f3a919eafd55a860dd61092057ecbf729cce902671e7046fe81fb0baacbd699f4968bdb571b3fe8a10017f80b6341365291584003
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/bake/covered/debug.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2022-
|
4
|
+
# Copyright, 2022-2025, by Samuel Williams.
|
5
5
|
|
6
6
|
def initialize(context)
|
7
7
|
super
|
8
8
|
|
9
|
-
require_relative
|
9
|
+
require_relative "../../lib/covered"
|
10
10
|
end
|
11
11
|
|
12
12
|
# Debug the coverage of a file. Show which lines should be executable.
|
data/bake/covered/policy.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2023-
|
4
|
+
# Copyright, 2023-2025, by Samuel Williams.
|
5
5
|
# Copyright, 2023, by Michael Adams.
|
6
6
|
|
7
7
|
def initialize(context)
|
8
8
|
super
|
9
9
|
|
10
|
-
require_relative
|
10
|
+
require_relative "../../lib/covered/config"
|
11
11
|
end
|
12
12
|
|
13
13
|
# Load the current coverage policy.
|
data/bake/covered/validate.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2022-
|
4
|
+
# Copyright, 2022-2025, by Samuel Williams.
|
5
5
|
|
6
6
|
def initialize(context)
|
7
7
|
super
|
8
8
|
|
9
|
-
require_relative
|
9
|
+
require_relative "../../lib/covered/config"
|
10
10
|
end
|
11
11
|
|
12
12
|
# Validate the coverage of multiple test runs.
|
@@ -0,0 +1,355 @@
|
|
1
|
+
# Configuration
|
2
|
+
|
3
|
+
This guide will help you to configure covered for your project's specific requirements.
|
4
|
+
|
5
|
+
## Quick Start
|
6
|
+
|
7
|
+
The simplest way to configure covered is through environment variables:
|
8
|
+
|
9
|
+
``` bash
|
10
|
+
# Basic coverage with default report
|
11
|
+
COVERAGE=true rspec
|
12
|
+
|
13
|
+
# Specific report types
|
14
|
+
COVERAGE=PartialSummary rspec
|
15
|
+
COVERAGE=BriefSummary rspec
|
16
|
+
COVERAGE=MarkdownSummary rspec
|
17
|
+
|
18
|
+
# Multiple reports (comma-separated)
|
19
|
+
COVERAGE=PartialSummary,BriefSummary rspec
|
20
|
+
```
|
21
|
+
|
22
|
+
## Configuration File
|
23
|
+
|
24
|
+
For advanced configuration, create a `config/covered.rb` file in your project:
|
25
|
+
|
26
|
+
~~~ ruby
|
27
|
+
# config/covered.rb
|
28
|
+
|
29
|
+
def ignore_paths
|
30
|
+
super + ["engines/", "app/assets/", "db/migrate/"]
|
31
|
+
end
|
32
|
+
|
33
|
+
def include_patterns
|
34
|
+
super + ["bake/**/*.rb", "engines/**/*.rb"]
|
35
|
+
end
|
36
|
+
|
37
|
+
def make_policy(policy)
|
38
|
+
super
|
39
|
+
|
40
|
+
# Custom policy configuration
|
41
|
+
policy.skip(/\/generated\//)
|
42
|
+
policy.include("lib/templates/**/*.erb")
|
43
|
+
end
|
44
|
+
~~~
|
45
|
+
|
46
|
+
## Environment Variables
|
47
|
+
|
48
|
+
Covered uses several environment variables for configuration:
|
49
|
+
|
50
|
+
| Variable | Description | Default |
|
51
|
+
|----------------|-----------------------------------|--------------------|
|
52
|
+
| `COVERAGE` | Report types to generate | `nil` (no reports) |
|
53
|
+
| `COVERED_ROOT` | Project root directory | `Dir.pwd` |
|
54
|
+
| `RUBYOPT` | Modified internally for autostart | Current value |
|
55
|
+
|
56
|
+
### Examples
|
57
|
+
|
58
|
+
``` bash
|
59
|
+
# Disable coverage entirely
|
60
|
+
unset COVERAGE
|
61
|
+
|
62
|
+
# Enable default report (BriefSummary)
|
63
|
+
COVERAGE=true
|
64
|
+
|
65
|
+
# Custom project root
|
66
|
+
COVERED_ROOT=/path/to/project COVERAGE=PartialSummary rspec
|
67
|
+
```
|
68
|
+
|
69
|
+
## Report Types
|
70
|
+
|
71
|
+
Covered provides several built-in report types:
|
72
|
+
|
73
|
+
### Summary Reports
|
74
|
+
|
75
|
+
- **`Summary`** - Full detailed coverage report with line-by-line analysis
|
76
|
+
- **`FullSummary`** - Complete coverage without threshold filtering
|
77
|
+
- **`BriefSummary`** - Shows overall statistics + top 5 files with least coverage
|
78
|
+
- **`PartialSummary`** - Shows only code segments with incomplete coverage + lists 100% covered files
|
79
|
+
- **`MarkdownSummary`** - Coverage report formatted as Markdown
|
80
|
+
- **`Quiet`** - Suppresses all output
|
81
|
+
|
82
|
+
### Usage Examples
|
83
|
+
|
84
|
+
``` ruby
|
85
|
+
# In config/covered.rb
|
86
|
+
def make_policy(policy)
|
87
|
+
super
|
88
|
+
|
89
|
+
# Add multiple reports
|
90
|
+
policy.reports << Covered::PartialSummary.new
|
91
|
+
policy.reports << Covered::MarkdownSummary.new(threshold: 0.8)
|
92
|
+
end
|
93
|
+
```
|
94
|
+
|
95
|
+
## Path Configuration
|
96
|
+
|
97
|
+
### Ignoring Paths
|
98
|
+
|
99
|
+
Default ignored paths include `test/`, `spec/`, `fixtures/`, `vendor/`, and `config/`. Customize with:
|
100
|
+
|
101
|
+
``` ruby
|
102
|
+
def ignore_paths
|
103
|
+
super + [
|
104
|
+
"engines/", # Engine directories
|
105
|
+
"app/assets/", # Asset files
|
106
|
+
"db/migrate/", # Database migrations
|
107
|
+
"tmp/", # Temporary files
|
108
|
+
"log/", # Log files
|
109
|
+
"coverage/", # Coverage output
|
110
|
+
"public/packs/" # Webpack outputs
|
111
|
+
]
|
112
|
+
end
|
113
|
+
```
|
114
|
+
|
115
|
+
### Including Patterns
|
116
|
+
|
117
|
+
Default includes `lib/**/*.rb`. Extend for additional patterns:
|
118
|
+
|
119
|
+
``` ruby
|
120
|
+
def include_patterns
|
121
|
+
super + [
|
122
|
+
"app/**/*.rb", # Application code
|
123
|
+
"bake/**/*.rb", # Bake tasks
|
124
|
+
"engines/**/*.rb", # Engine code
|
125
|
+
"lib/templates/**/*.erb" # Template files (Ruby 3.2+)
|
126
|
+
]
|
127
|
+
end
|
128
|
+
```
|
129
|
+
|
130
|
+
## Advanced Policy Configuration
|
131
|
+
|
132
|
+
The `make_policy` method provides fine-grained control:
|
133
|
+
|
134
|
+
``` ruby
|
135
|
+
def make_policy(policy)
|
136
|
+
super
|
137
|
+
|
138
|
+
# Filter by regex patterns
|
139
|
+
policy.skip(/\/generated\//) # Skip generated files
|
140
|
+
policy.skip(/\.generated\.rb$/) # Skip files ending in .generated.rb
|
141
|
+
|
142
|
+
# Include specific files
|
143
|
+
policy.include("config/application.rb")
|
144
|
+
|
145
|
+
# Only track specific patterns
|
146
|
+
policy.only(/^app\//)
|
147
|
+
|
148
|
+
# Set custom root
|
149
|
+
policy.root(File.expand_path('..', __dir__))
|
150
|
+
|
151
|
+
# Enable persistent coverage across runs
|
152
|
+
policy.persist!
|
153
|
+
|
154
|
+
# Configure reports programmatically
|
155
|
+
if ENV['CI']
|
156
|
+
policy.reports << Covered::MarkdownSummary.new
|
157
|
+
else
|
158
|
+
policy.reports << Covered::PartialSummary.new
|
159
|
+
end
|
160
|
+
end
|
161
|
+
```
|
162
|
+
|
163
|
+
## Common Configuration Patterns
|
164
|
+
|
165
|
+
### Rails Applications
|
166
|
+
|
167
|
+
``` ruby
|
168
|
+
def ignore_paths
|
169
|
+
super + [
|
170
|
+
"app/assets/",
|
171
|
+
"db/migrate/",
|
172
|
+
"db/seeds.rb",
|
173
|
+
"config/environments/",
|
174
|
+
"config/initializers/",
|
175
|
+
"tmp/",
|
176
|
+
"log/",
|
177
|
+
"public/",
|
178
|
+
"storage/"
|
179
|
+
]
|
180
|
+
end
|
181
|
+
|
182
|
+
def include_patterns
|
183
|
+
super + [
|
184
|
+
"app/**/*.rb",
|
185
|
+
"lib/**/*.rb",
|
186
|
+
"config/application.rb",
|
187
|
+
"config/routes.rb"
|
188
|
+
]
|
189
|
+
end
|
190
|
+
```
|
191
|
+
|
192
|
+
### Gem Development
|
193
|
+
|
194
|
+
``` ruby
|
195
|
+
def ignore_paths
|
196
|
+
super + ["examples/", "benchmark/"]
|
197
|
+
end
|
198
|
+
|
199
|
+
def include_patterns
|
200
|
+
super + ["bin/**/*.rb"]
|
201
|
+
end
|
202
|
+
|
203
|
+
def make_policy(policy)
|
204
|
+
super
|
205
|
+
|
206
|
+
# Only track the gem's main code
|
207
|
+
policy.only(/^lib\//)
|
208
|
+
end
|
209
|
+
```
|
210
|
+
|
211
|
+
### Monorepo/Multi-Engine
|
212
|
+
|
213
|
+
``` ruby
|
214
|
+
def ignore_paths
|
215
|
+
super + [
|
216
|
+
"engines/*/spec/",
|
217
|
+
"engines/*/test/",
|
218
|
+
"shared/fixtures/"
|
219
|
+
]
|
220
|
+
end
|
221
|
+
|
222
|
+
def include_patterns
|
223
|
+
super + [
|
224
|
+
"engines/*/lib/**/*.rb",
|
225
|
+
"engines/*/app/**/*.rb",
|
226
|
+
"shared/lib/**/*.rb"
|
227
|
+
]
|
228
|
+
end
|
229
|
+
```
|
230
|
+
|
231
|
+
## Template Coverage (Ruby 3.2+)
|
232
|
+
|
233
|
+
For projects using ERB, Haml, or other template engines:
|
234
|
+
|
235
|
+
``` ruby
|
236
|
+
def include_patterns
|
237
|
+
super + [
|
238
|
+
"app/views/**/*.erb",
|
239
|
+
"lib/templates/**/*.erb",
|
240
|
+
"app/views/**/*.haml"
|
241
|
+
]
|
242
|
+
end
|
243
|
+
|
244
|
+
def make_policy(policy)
|
245
|
+
super
|
246
|
+
|
247
|
+
# Ensure template coverage is enabled
|
248
|
+
require 'covered/erb' if defined?(ERB)
|
249
|
+
end
|
250
|
+
```
|
251
|
+
|
252
|
+
## CI/CD Integration
|
253
|
+
|
254
|
+
### GitHub Actions
|
255
|
+
|
256
|
+
``` ruby
|
257
|
+
def make_policy(policy)
|
258
|
+
super
|
259
|
+
|
260
|
+
if ENV['GITHUB_ACTIONS']
|
261
|
+
# Use markdown format for GitHub
|
262
|
+
policy.reports << Covered::MarkdownSummary.new
|
263
|
+
|
264
|
+
# Fail build on low coverage
|
265
|
+
policy.reports << Class.new do
|
266
|
+
def call(wrapper, output = $stdout)
|
267
|
+
statistics = wrapper.each.inject(Statistics.new) { |s, c| s << c }
|
268
|
+
if statistics.ratio < 0.90
|
269
|
+
exit 1
|
270
|
+
end
|
271
|
+
end
|
272
|
+
end.new
|
273
|
+
end
|
274
|
+
end
|
275
|
+
```
|
276
|
+
|
277
|
+
### Custom Thresholds
|
278
|
+
|
279
|
+
``` ruby
|
280
|
+
def make_policy(policy)
|
281
|
+
super
|
282
|
+
|
283
|
+
# Different thresholds for different environments
|
284
|
+
threshold = case ENV['RAILS_ENV']
|
285
|
+
when 'production' then 0.95
|
286
|
+
when 'staging' then 0.90
|
287
|
+
else 0.80
|
288
|
+
end
|
289
|
+
|
290
|
+
policy.reports << Covered::Summary.new(threshold: threshold)
|
291
|
+
end
|
292
|
+
```
|
293
|
+
|
294
|
+
## Performance Optimization
|
295
|
+
|
296
|
+
For large codebases:
|
297
|
+
|
298
|
+
``` ruby
|
299
|
+
def make_policy(policy)
|
300
|
+
super
|
301
|
+
|
302
|
+
# Skip large generated directories
|
303
|
+
policy.skip(/\/node_modules\//)
|
304
|
+
policy.skip(/\/vendor\/bundle\//)
|
305
|
+
policy.skip(/\/coverage\//)
|
306
|
+
|
307
|
+
# Use more efficient reports for large projects
|
308
|
+
if Dir['**/*.rb'].length > 1000
|
309
|
+
policy.reports << Covered::BriefSummary.new
|
310
|
+
else
|
311
|
+
policy.reports << Covered::PartialSummary.new
|
312
|
+
end
|
313
|
+
end
|
314
|
+
```
|
315
|
+
|
316
|
+
## Troubleshooting
|
317
|
+
|
318
|
+
### Common Issues
|
319
|
+
|
320
|
+
**Coverage not working:**
|
321
|
+
- Ensure `require 'covered/rspec'` (or similar) is at the top of your test helper
|
322
|
+
- Check that `COVERAGE` environment variable is set
|
323
|
+
- Verify the configuration file path is correct: `config/covered.rb`
|
324
|
+
|
325
|
+
**Missing files in reports:**
|
326
|
+
- Files must be required/loaded during test execution to be tracked
|
327
|
+
- Use `include_patterns` to track files not loaded by tests
|
328
|
+
- Check `ignore_paths` isn't excluding desired files
|
329
|
+
|
330
|
+
**Performance issues:**
|
331
|
+
- Use `BriefSummary` instead of `Summary` for large codebases
|
332
|
+
- Add more specific patterns to `ignore_paths`
|
333
|
+
- Use `policy.only()` to limit scope
|
334
|
+
|
335
|
+
**Template coverage not working:**
|
336
|
+
- Requires Ruby 3.2+ for full template support
|
337
|
+
- Ensure template engines are loaded before coverage starts
|
338
|
+
- Check that template files match `include_patterns`
|
339
|
+
|
340
|
+
### Debug Configuration
|
341
|
+
|
342
|
+
``` ruby
|
343
|
+
def make_policy(policy)
|
344
|
+
super
|
345
|
+
|
346
|
+
# Debug: print current configuration
|
347
|
+
if ENV['DEBUG_COVERAGE']
|
348
|
+
puts "Ignore paths: #{ignore_paths}"
|
349
|
+
puts "Include patterns: #{include_patterns}"
|
350
|
+
puts "Root: #{@root}"
|
351
|
+
end
|
352
|
+
end
|
353
|
+
```
|
354
|
+
|
355
|
+
See the {ruby Covered::Config} class for complete API documentation.
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# Getting Started
|
2
|
+
|
3
|
+
This guide explains how to get started with `covered` and integrate it with your test suite.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's `Gemfile`:
|
8
|
+
|
9
|
+
``` ruby
|
10
|
+
gem 'covered'
|
11
|
+
```
|
12
|
+
|
13
|
+
### Sus Integration
|
14
|
+
|
15
|
+
In your `config/sus.rb` add the following:
|
16
|
+
|
17
|
+
``` ruby
|
18
|
+
require 'covered/sus'
|
19
|
+
include Covered::Sus
|
20
|
+
```
|
21
|
+
|
22
|
+
### RSpec Integration
|
23
|
+
|
24
|
+
In your `spec/spec_helper.rb` add the following before loading any other code:
|
25
|
+
|
26
|
+
``` ruby
|
27
|
+
require 'covered/rspec'
|
28
|
+
```
|
29
|
+
|
30
|
+
Ensure that you have a `.rspec` file with `--require spec_helper`:
|
31
|
+
|
32
|
+
--require spec_helper
|
33
|
+
--format documentation
|
34
|
+
--warnings
|
35
|
+
|
36
|
+
### Minitest Integration
|
37
|
+
|
38
|
+
In your `test/test_helper.rb` add the following before loading any other code:
|
39
|
+
|
40
|
+
``` ruby
|
41
|
+
require 'covered/minitest'
|
42
|
+
require 'minitest/autorun'
|
43
|
+
```
|
44
|
+
|
45
|
+
In your test files, e.g. `test/dummy_test.rb` add the following at the top:
|
46
|
+
|
47
|
+
``` ruby
|
48
|
+
require_relative 'test_helper'
|
49
|
+
```
|
50
|
+
|
51
|
+
### Template Coverage
|
52
|
+
|
53
|
+
Covered supports coverage of templates which are compiled into Ruby code. This is only supported on Ruby 3.2+ due to
|
54
|
+
enhancements in the coverage interface.
|
55
|
+
|
56
|
+
### Partial Summary
|
57
|
+
|
58
|
+
COVERAGE=PartialSummary rspec
|
59
|
+
|
60
|
+
This report only shows snippets of source code with incomplete coverage.
|
61
|
+
|
62
|
+
### Brief Summary
|
63
|
+
|
64
|
+
COVERAGE=BriefSummary rspec
|
65
|
+
|
66
|
+
This report lists several files in order of least coverage.l
|
data/context/index.yaml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Automatically generated context index for Utopia::Project guides.
|
2
|
+
# Do not edit then files in this directory directly, instead edit the guides and then run `bake utopia:project:agent:context:update`.
|
3
|
+
---
|
4
|
+
description: A modern approach to code coverage.
|
5
|
+
metadata:
|
6
|
+
documentation_uri: https://socketry.github.io/covered/
|
7
|
+
funding_uri: https://github.com/sponsors/ioquatix/
|
8
|
+
source_code_uri: https://github.com/socketry/covered.git
|
9
|
+
files:
|
10
|
+
- path: getting-started.md
|
11
|
+
title: Getting Started
|
12
|
+
description: This guide explains how to get started with `covered` and integrate
|
13
|
+
it with your test suite.
|
14
|
+
- path: configuration.md
|
15
|
+
title: Configuration
|
16
|
+
description: This guide will help you to configure covered for your project's specific
|
17
|
+
requirements.
|
data/context/usage.md
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
## General Information
|
2
|
+
|
3
|
+
As per the official documentation, `covered` is a modern code-coverage library for Ruby.
|
4
|
+
|
5
|
+
Instead of relying only on Ruby’s built-in `Coverage` API, it combines **tracepoints** with
|
6
|
+
static analysis from the `parser` gem so it can track _any_ Ruby that eventually gets executed
|
7
|
+
(including code produced by `eval`, or templates such as ERB/ HAML that are compiled to Ruby).
|
8
|
+
Because it knows which lines are _actually_ executable, the reported percentages are usually
|
9
|
+
more accurate than classic line-count tools like SimpleCov.
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add this line to your application's `Gemfile`:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'covered'
|
17
|
+
```
|
18
|
+
|
19
|
+
## Configuration
|
20
|
+
|
21
|
+
### Configure what you see
|
22
|
+
|
23
|
+
Under the hood, `covered` uses a single environment variable `COVERAGE` to:
|
24
|
+
1. turn the coverage tracking on/ off
|
25
|
+
2. allow the user to select how much detail to be printed
|
26
|
+
|
27
|
+
By default, when the `COVERAGE` is not specifically set anywhere, you will not see anything, and nothing will be stored during the runs.
|
28
|
+
|
29
|
+
You can modify this behavior either by defining the environment variable or specifying it when running the tests command. Your choices of values are:
|
30
|
+
1. `BriefSummary` - you see a brief summary showcasing the overall percentage of line coverage.
|
31
|
+
- Ideally you would use this for quick feedback locally
|
32
|
+
- You can also use this to set a threshold through Github Actions around merging rules in Pull Requests.
|
33
|
+
2. `PartialSummary` - you see contextual snippets around missing lines
|
34
|
+
- Ideally you would use this for quickly investigating missing coverage in specific files
|
35
|
+
- You can also use this to set a threshold through Github Actions around merging rules in Pull Requests, and also deliver information about which lines are not tested to the developer.
|
36
|
+
3. `FullSummary` - you see every line, both covered and uncovered, which may be overwhelming
|
37
|
+
- Ideally you would use this when doing a deep dive that requires verbosity.
|
38
|
+
4. `Quiet` - you do not see anything in the console but the coverage is saved internally for later usage
|
39
|
+
- Ideally used in CI pipelines.
|
40
|
+
|
41
|
+
### Configure file choices for coverage
|
42
|
+
|
43
|
+
You can configure covered by creating a `config/covered.rb` file in your project.
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
def ignore_paths
|
47
|
+
super + ["engines/"]
|
48
|
+
end
|
49
|
+
|
50
|
+
def include_patterns
|
51
|
+
super + ["bake/**/*.rb"]
|
52
|
+
end
|
53
|
+
```
|
54
|
+
|
55
|
+
1. `ignore_paths` specifies which paths to ignore when computing coverage for a given project.
|
56
|
+
2. `include_patterns` specifies which paths to include when computing coverage for a given project.
|
57
|
+
|
58
|
+
More information around the Configuration possibilities can be found here: https://socketry.github.io/covered/source/Covered/Config/index.html.
|
59
|
+
|
60
|
+
One possibly helpful functionality to take note of is that you can override the `make_policy` method in order to implement your own policy.
|
61
|
+
## Integration
|
62
|
+
|
63
|
+
### Sus Integration
|
64
|
+
|
65
|
+
In your `config/sus.rb` add the following:
|
66
|
+
|
67
|
+
```ruby
|
68
|
+
require 'covered/sus'
|
69
|
+
include Covered::Sus
|
70
|
+
```
|
71
|
+
### RSpec Integration
|
72
|
+
|
73
|
+
In your `spec/spec_helper.rb` add the following before loading any other code:
|
74
|
+
|
75
|
+
```ruby
|
76
|
+
require 'covered/rspec'
|
77
|
+
```
|
78
|
+
|
79
|
+
Ensure that you have a `.rspec` file with `--require spec_helper`:
|
80
|
+
|
81
|
+
```plain
|
82
|
+
--require spec_helper
|
83
|
+
--format documentation
|
84
|
+
--warnings
|
85
|
+
```
|
86
|
+
|
87
|
+
### Minitest Integration
|
88
|
+
|
89
|
+
In your `test/test_helper.rb` add the following before loading any other code:
|
90
|
+
|
91
|
+
```ruby
|
92
|
+
require 'covered/minitest'
|
93
|
+
require 'minitest/autorun'
|
94
|
+
```
|
95
|
+
|
96
|
+
In your test files, e.g. `test/dummy_test.rb` add the following at the top:
|
97
|
+
|
98
|
+
```ruby
|
99
|
+
require_relative 'test_helper'
|
100
|
+
```
|
101
|
+
|
102
|
+
|
103
|
+
## Coverage Improvement
|
104
|
+
|
105
|
+
The taxonomy of tests isn't really relevant for the purpose of improving the coverage and the safety of your codebase.
|
106
|
+
|
107
|
+
You are going to think about tests by referring to the level of software processes that they test. When trying to improve coverage, you must first understand what the purpose of the on-going process is, with the scope of coverage in mind:
|
108
|
+
1. Verifying individual components - you are going to be writing Unit Tests.
|
109
|
+
2. Verifying interaction between multiple units - you are going to be writing Integration Tests.
|
110
|
+
3. Verifying end-to-end-workflows - you are going to be writing System Tests.
|
data/lib/covered/autostart.rb
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2025, by Samuel Williams.
|
5
|
+
|
6
|
+
require_relative "summary"
|
7
|
+
|
8
|
+
module Covered
|
9
|
+
class BriefSummary < Summary
|
10
|
+
def call(wrapper, output = $stdout, before: 4, after: 4)
|
11
|
+
terminal = self.terminal(output)
|
12
|
+
|
13
|
+
ordered = []
|
14
|
+
|
15
|
+
statistics = self.each(wrapper) do |coverage|
|
16
|
+
ordered << coverage unless coverage.complete?
|
17
|
+
end
|
18
|
+
|
19
|
+
terminal.puts
|
20
|
+
statistics.print(output)
|
21
|
+
|
22
|
+
if ordered.any?
|
23
|
+
terminal.puts "", "Least Coverage:"
|
24
|
+
ordered.sort_by!(&:missing_count).reverse!
|
25
|
+
|
26
|
+
ordered.first(5).each do |coverage|
|
27
|
+
path = wrapper.relative_path(coverage.path)
|
28
|
+
|
29
|
+
terminal.write path, style: :brief_path
|
30
|
+
terminal.puts ": #{coverage.missing_count} lines not executed!"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/covered/capture.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2018-
|
4
|
+
# Copyright, 2018-2025, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
6
|
+
require_relative "wrapper"
|
7
7
|
|
8
|
-
require
|
8
|
+
require "coverage"
|
9
9
|
|
10
10
|
module Covered
|
11
11
|
class Capture < Wrapper
|
data/lib/covered/config.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2019-
|
4
|
+
# Copyright, 2019-2025, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
6
|
+
require_relative "policy"
|
7
7
|
|
8
8
|
module Covered
|
9
9
|
class Config
|
10
10
|
PATH = "config/covered.rb"
|
11
11
|
|
12
12
|
def self.root
|
13
|
-
ENV[
|
13
|
+
ENV["COVERED_ROOT"] || Dir.pwd
|
14
14
|
end
|
15
15
|
|
16
16
|
def self.path(root)
|
@@ -22,7 +22,7 @@ module Covered
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def self.reports
|
25
|
-
ENV[
|
25
|
+
ENV["COVERAGE"]
|
26
26
|
end
|
27
27
|
|
28
28
|
def self.load(root: self.root, reports: self.reports)
|
@@ -94,7 +94,7 @@ module Covered
|
|
94
94
|
# Which paths to ignore when computing coverage for a given project.
|
95
95
|
# @returns [Array(String)] An array of relative paths to ignore.
|
96
96
|
def ignore_paths
|
97
|
-
[
|
97
|
+
["test/", "fixtures/", "spec/", "vendor/", "config/"]
|
98
98
|
end
|
99
99
|
|
100
100
|
# Which paths to include when computing coverage for a given project.
|
@@ -127,23 +127,23 @@ module Covered
|
|
127
127
|
|
128
128
|
protected
|
129
129
|
|
130
|
-
REQUIRE_COVERED_AUTOSTART =
|
130
|
+
REQUIRE_COVERED_AUTOSTART = "-rcovered/autostart"
|
131
131
|
|
132
132
|
def autostart!
|
133
|
-
if rubyopt = ENV[
|
134
|
-
rubyopt = [rubyopt.strip, REQUIRE_COVERED_AUTOSTART].join(
|
133
|
+
if rubyopt = ENV["RUBYOPT"] and !rubyopt.empty?
|
134
|
+
rubyopt = [rubyopt.strip, REQUIRE_COVERED_AUTOSTART].join(" ")
|
135
135
|
else
|
136
136
|
rubyopt = REQUIRE_COVERED_AUTOSTART
|
137
137
|
end
|
138
138
|
|
139
|
-
ENV[
|
139
|
+
ENV["RUBYOPT"] = rubyopt
|
140
140
|
|
141
|
-
unless ENV[
|
142
|
-
ENV[
|
141
|
+
unless ENV["COVERED_ROOT"]
|
142
|
+
ENV["COVERED_ROOT"] = @root
|
143
143
|
end
|
144
144
|
|
145
145
|
# Don't report coverage in child processes:
|
146
|
-
ENV.delete(
|
146
|
+
ENV.delete("COVERAGE")
|
147
147
|
end
|
148
148
|
end
|
149
149
|
end
|
data/lib/covered/coverage.rb
CHANGED
data/lib/covered/files.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2018-
|
4
|
+
# Copyright, 2018-2025, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
7
|
-
require_relative
|
6
|
+
require_relative "coverage"
|
7
|
+
require_relative "wrapper"
|
8
8
|
|
9
|
-
require
|
9
|
+
require "set"
|
10
10
|
|
11
11
|
module Covered
|
12
12
|
class Files < Base
|
data/lib/covered/forks.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2021-
|
4
|
+
# Copyright, 2021-2025, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
7
|
-
require_relative
|
6
|
+
require_relative "statistics"
|
7
|
+
require_relative "wrapper"
|
8
8
|
|
9
|
-
require
|
9
|
+
require "console/output"
|
10
10
|
|
11
11
|
module Covered
|
12
12
|
class MarkdownSummary
|
@@ -56,7 +56,7 @@ module Covered
|
|
56
56
|
|
57
57
|
# A coverage array gives, for each line, the number of line execution by the interpreter. A nil value means coverage is finishd for this line (lines like else and end).
|
58
58
|
def call(wrapper, output = $stdout)
|
59
|
-
output.puts
|
59
|
+
output.puts "# Coverage Report"
|
60
60
|
output.puts
|
61
61
|
|
62
62
|
ordered = []
|
data/lib/covered/minitest.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2019-
|
4
|
+
# Copyright, 2019-2025, by Samuel Williams.
|
5
5
|
# Copyright, 2022, by Adam Daniels.
|
6
6
|
|
7
|
-
require_relative
|
7
|
+
require_relative "config"
|
8
8
|
|
9
|
-
require
|
9
|
+
require "minitest"
|
10
10
|
|
11
11
|
$covered = Covered::Config.load
|
12
12
|
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2025, by Samuel Williams.
|
5
|
+
|
6
|
+
require_relative "summary"
|
7
|
+
|
8
|
+
module Covered
|
9
|
+
class PartialSummary < Summary
|
10
|
+
def print_coverage(terminal, coverage, before: 4, after: 4)
|
11
|
+
return if coverage.zero?
|
12
|
+
|
13
|
+
line_offset = 1
|
14
|
+
counts = coverage.counts
|
15
|
+
last_line = nil
|
16
|
+
|
17
|
+
coverage.read do |file|
|
18
|
+
print_line_header(terminal)
|
19
|
+
|
20
|
+
file.each_line do |line|
|
21
|
+
range = Range.new([line_offset - before, 0].max, line_offset+after)
|
22
|
+
|
23
|
+
if counts[range]&.include?(0)
|
24
|
+
count = counts[line_offset]
|
25
|
+
|
26
|
+
if last_line and last_line != line_offset-1
|
27
|
+
terminal.puts ":".rjust(16)
|
28
|
+
end
|
29
|
+
|
30
|
+
print_annotations(terminal, coverage, line, line_offset)
|
31
|
+
print_line(terminal, line, line_offset, count)
|
32
|
+
|
33
|
+
last_line = line_offset
|
34
|
+
end
|
35
|
+
|
36
|
+
line_offset += 1
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def call(wrapper, output = $stdout, **options)
|
42
|
+
terminal = self.terminal(output)
|
43
|
+
complete_files = []
|
44
|
+
|
45
|
+
statistics = self.each(wrapper) do |coverage|
|
46
|
+
path = wrapper.relative_path(coverage.path)
|
47
|
+
terminal.puts ""
|
48
|
+
terminal.puts path, style: :path
|
49
|
+
|
50
|
+
begin
|
51
|
+
print_coverage(terminal, coverage, **options)
|
52
|
+
rescue => error
|
53
|
+
print_error(terminal, error)
|
54
|
+
end
|
55
|
+
|
56
|
+
coverage.print(output)
|
57
|
+
end
|
58
|
+
|
59
|
+
# Collect files with 100% coverage that were not shown
|
60
|
+
wrapper.each do |coverage|
|
61
|
+
if coverage.ratio >= 1.0
|
62
|
+
complete_files << wrapper.relative_path(coverage.path)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
terminal.puts
|
67
|
+
statistics.print(output)
|
68
|
+
|
69
|
+
# Show information about files with 100% coverage
|
70
|
+
if complete_files.any?
|
71
|
+
terminal.puts ""
|
72
|
+
if complete_files.size == 1
|
73
|
+
terminal.puts "1 file has 100% coverage and is not shown above:"
|
74
|
+
else
|
75
|
+
terminal.puts "#{complete_files.size} files have 100% coverage and are not shown above:"
|
76
|
+
end
|
77
|
+
|
78
|
+
complete_files.sort.each do |path|
|
79
|
+
terminal.write " - ", style: :covered_prefix
|
80
|
+
terminal.puts path, style: :brief_path
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
data/lib/covered/persist.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2019-
|
4
|
+
# Copyright, 2019-2025, by Samuel Williams.
|
5
5
|
# Copyright, 2023, by Stephen Ierodiaconou.
|
6
6
|
|
7
|
-
require_relative
|
7
|
+
require_relative "wrapper"
|
8
8
|
|
9
|
-
require
|
10
|
-
require
|
9
|
+
require "msgpack"
|
10
|
+
require "time"
|
11
11
|
|
12
12
|
module Covered
|
13
13
|
class Persist < Wrapper
|
data/lib/covered/policy.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2018-
|
4
|
+
# Copyright, 2018-2025, by Samuel Williams.
|
5
5
|
|
6
6
|
require_relative "summary"
|
7
7
|
require_relative "files"
|
@@ -93,7 +93,7 @@ module Covered
|
|
93
93
|
private
|
94
94
|
|
95
95
|
def snake_case(string)
|
96
|
-
return string.gsub(/::/,
|
96
|
+
return string.gsub(/::/, "/").
|
97
97
|
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
|
98
98
|
gsub(/([a-z\d])([A-Z])/,'\1_\2').
|
99
99
|
tr("-", "_").
|
@@ -103,7 +103,7 @@ module Covered
|
|
103
103
|
|
104
104
|
def reports!(reports)
|
105
105
|
if reports.is_a?(String)
|
106
|
-
names = reports.split(
|
106
|
+
names = reports.split(",")
|
107
107
|
|
108
108
|
names.each do |name|
|
109
109
|
begin
|
data/lib/covered/rspec.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2018-
|
4
|
+
# Copyright, 2018-2025, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
7
|
-
require
|
6
|
+
require_relative "config"
|
7
|
+
require "rspec/core/formatters"
|
8
8
|
|
9
9
|
$covered = Covered::Config.load
|
10
10
|
|
@@ -30,7 +30,7 @@ end
|
|
30
30
|
|
31
31
|
if $covered.record?
|
32
32
|
RSpec::Core::Configuration.prepend(Covered::RSpec::Policy)
|
33
|
-
|
33
|
+
|
34
34
|
RSpec.configure do |config|
|
35
35
|
config.after(:suite) do
|
36
36
|
$covered.finish
|
data/lib/covered/statistics.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2018-
|
4
|
+
# Copyright, 2018-2025, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
7
|
-
require_relative
|
6
|
+
require_relative "wrapper"
|
7
|
+
require_relative "coverage"
|
8
8
|
|
9
9
|
module Covered
|
10
10
|
class CoverageError < StandardError
|
data/lib/covered/summary.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2018-
|
4
|
+
# Copyright, 2018-2025, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
7
|
-
require_relative
|
6
|
+
require_relative "statistics"
|
7
|
+
require_relative "wrapper"
|
8
8
|
|
9
9
|
module Covered
|
10
10
|
class Summary
|
@@ -13,7 +13,7 @@ module Covered
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def terminal(output)
|
16
|
-
require
|
16
|
+
require "console/terminal"
|
17
17
|
|
18
18
|
Console::Terminal.for(output).tap do |terminal|
|
19
19
|
terminal[:path] ||= terminal.style(nil, nil, :bold, :underline)
|
@@ -136,66 +136,6 @@ module Covered
|
|
136
136
|
end
|
137
137
|
end
|
138
138
|
|
139
|
-
class BriefSummary < Summary
|
140
|
-
def call(wrapper, output = $stdout, before: 4, after: 4)
|
141
|
-
terminal = self.terminal(output)
|
142
|
-
|
143
|
-
ordered = []
|
144
|
-
|
145
|
-
statistics = self.each(wrapper) do |coverage|
|
146
|
-
ordered << coverage unless coverage.complete?
|
147
|
-
end
|
148
|
-
|
149
|
-
terminal.puts
|
150
|
-
statistics.print(output)
|
151
|
-
|
152
|
-
if ordered.any?
|
153
|
-
terminal.puts "", "Least Coverage:"
|
154
|
-
ordered.sort_by!(&:missing_count).reverse!
|
155
|
-
|
156
|
-
ordered.first(5).each do |coverage|
|
157
|
-
path = wrapper.relative_path(coverage.path)
|
158
|
-
|
159
|
-
terminal.write path, style: :brief_path
|
160
|
-
terminal.puts ": #{coverage.missing_count} lines not executed!"
|
161
|
-
end
|
162
|
-
end
|
163
|
-
end
|
164
|
-
end
|
165
|
-
|
166
|
-
class PartialSummary < Summary
|
167
|
-
def print_coverage(terminal, coverage, before: 4, after: 4)
|
168
|
-
return if coverage.zero?
|
169
|
-
|
170
|
-
line_offset = 1
|
171
|
-
counts = coverage.counts
|
172
|
-
last_line = nil
|
173
|
-
|
174
|
-
coverage.read do |file|
|
175
|
-
print_line_header(terminal)
|
176
|
-
|
177
|
-
file.each_line do |line|
|
178
|
-
range = Range.new([line_offset - before, 0].max, line_offset+after)
|
179
|
-
|
180
|
-
if counts[range]&.include?(0)
|
181
|
-
count = counts[line_offset]
|
182
|
-
|
183
|
-
if last_line and last_line != line_offset-1
|
184
|
-
terminal.puts ":".rjust(16)
|
185
|
-
end
|
186
|
-
|
187
|
-
print_annotations(terminal, coverage, line, line_offset)
|
188
|
-
print_line(terminal, line, line_offset, count)
|
189
|
-
|
190
|
-
last_line = line_offset
|
191
|
-
end
|
192
|
-
|
193
|
-
line_offset += 1
|
194
|
-
end
|
195
|
-
end
|
196
|
-
end
|
197
|
-
end
|
198
|
-
|
199
139
|
class Quiet
|
200
140
|
def call(wrapper, output = $stdout)
|
201
141
|
# Silent.
|
data/lib/covered/sus.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2019-
|
4
|
+
# Copyright, 2019-2025, by Samuel Williams.
|
5
5
|
|
6
6
|
module Covered
|
7
7
|
module Sus
|
@@ -9,8 +9,8 @@ module Covered
|
|
9
9
|
super
|
10
10
|
|
11
11
|
# Defer loading the coverage configuration unless we are actually running with coverage startd to avoid performance cost/overhead.
|
12
|
-
if ENV[
|
13
|
-
require_relative
|
12
|
+
if ENV["COVERAGE"]
|
13
|
+
require_relative "config"
|
14
14
|
|
15
15
|
@covered = Covered::Config.load(root: self.root)
|
16
16
|
if @covered.record?
|
data/lib/covered/version.rb
CHANGED
data/lib/covered.rb
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2018-
|
4
|
+
# Copyright, 2018-2025, by Samuel Williams.
|
5
5
|
|
6
6
|
require_relative "covered/version"
|
7
7
|
require_relative "covered/policy"
|
8
|
+
|
9
|
+
require_relative "covered/brief_summary"
|
10
|
+
require_relative "covered/partial_summary"
|
data/license.md
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
# MIT License
|
2
2
|
|
3
|
-
Copyright, 2018-
|
3
|
+
Copyright, 2018-2025, by Samuel Williams.
|
4
4
|
Copyright, 2018, by Shannon Skipper.
|
5
5
|
Copyright, 2019, by Cyril Roelandt.
|
6
6
|
Copyright, 2022, by Adam Daniels.
|
7
7
|
Copyright, 2022, by Felix Yan.
|
8
8
|
Copyright, 2023, by Stephen Ierodiaconou.
|
9
9
|
Copyright, 2023, by Michael Adams.
|
10
|
+
Copyright, 2025, by Aron Latis.
|
10
11
|
|
11
12
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
12
13
|
of this software and associated documentation files (the "Software"), to deal
|
data/readme.md
CHANGED
@@ -11,7 +11,7 @@ into Ruby.
|
|
11
11
|
platforms.
|
12
12
|
- Supports coverage of views - templates compiled to Ruby code can be tracked for coverage reporting.
|
13
13
|
|
14
|
-
[](https://github.com/socketry/covered/actions?workflow=Test)
|
15
15
|
|
16
16
|
## Motivation
|
17
17
|
|
@@ -24,17 +24,29 @@ After this concept prooved useful, [it was integrated directly into Ruby](https:
|
|
24
24
|
|
25
25
|
## Usage
|
26
26
|
|
27
|
-
Please see the [project documentation](https://
|
27
|
+
Please see the [project documentation](https://socketry.github.io/covered/) for more details.
|
28
28
|
|
29
|
-
- [Getting Started](https://
|
29
|
+
- [Getting Started](https://socketry.github.io/covered/guides/getting-started/index) - This guide explains how to get started with `covered` and integrate it with your test suite.
|
30
30
|
|
31
|
-
- [Configuration](https://
|
31
|
+
- [Configuration](https://socketry.github.io/covered/guides/configuration/index) - This guide will help you to configure covered for your project's specific requirements.
|
32
|
+
|
33
|
+
## Releases
|
34
|
+
|
35
|
+
Please see the [project releases](https://socketry.github.io/covered/releases/index) for all releases.
|
36
|
+
|
37
|
+
### v0.28.0
|
38
|
+
|
39
|
+
- List files that have 100% coverage in `PartialSummary` output.
|
40
|
+
|
41
|
+
### v0.27.0
|
42
|
+
|
43
|
+
- Drop development dependeny on `trenni` and add dependeny on `xrb`.
|
32
44
|
|
33
45
|
## See Also
|
34
46
|
|
35
47
|
- [simplecov](https://github.com/colszowka/simplecov) – one of the original coverage implementations for Ruby, uses
|
36
48
|
the built-in `coverage` library.
|
37
|
-
- [sus](https://github.com/
|
49
|
+
- [sus](https://github.com/socketry/sus) - a test framework which uses `covered` to generate coverage reports.
|
38
50
|
|
39
51
|
## Contributing
|
40
52
|
|
@@ -48,8 +60,8 @@ We welcome contributions to this project.
|
|
48
60
|
|
49
61
|
### Developer Certificate of Origin
|
50
62
|
|
51
|
-
|
63
|
+
In order to protect users of this project, we require all contributors to comply with the [Developer Certificate of Origin](https://developercertificate.org/). This ensures that all contributions are properly licensed and attributed.
|
52
64
|
|
53
|
-
###
|
65
|
+
### Community Guidelines
|
54
66
|
|
55
|
-
This project is
|
67
|
+
This project is best served by a collaborative and respectful environment. Treat each other professionally, respect differing viewpoints, and engage constructively. Harassment, discrimination, or harmful behavior is not tolerated. Communicate clearly, listen actively, and support one another. If any issues arise, please inform the project maintainers.
|
data/releases.md
ADDED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: covered
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.28.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
- Adam Daniels
|
9
|
+
- Aron Latis
|
9
10
|
- Cyril Roelandt
|
10
11
|
- Felix Yan
|
11
12
|
- Michael Adams
|
12
13
|
- Shannon Skipper
|
13
14
|
- Stephen Ierodiaconou
|
14
|
-
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain:
|
17
17
|
- |
|
@@ -43,7 +43,7 @@ cert_chain:
|
|
43
43
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
44
44
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
45
45
|
-----END CERTIFICATE-----
|
46
|
-
date:
|
46
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
47
47
|
dependencies:
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: console
|
@@ -73,8 +73,6 @@ dependencies:
|
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '1.0'
|
76
|
-
description:
|
77
|
-
email:
|
78
76
|
executables: []
|
79
77
|
extensions: []
|
80
78
|
extra_rdoc_files: []
|
@@ -82,8 +80,13 @@ files:
|
|
82
80
|
- bake/covered/debug.rb
|
83
81
|
- bake/covered/policy.rb
|
84
82
|
- bake/covered/validate.rb
|
83
|
+
- context/configuration.md
|
84
|
+
- context/getting-started.md
|
85
|
+
- context/index.yaml
|
86
|
+
- context/usage.md
|
85
87
|
- lib/covered.rb
|
86
88
|
- lib/covered/autostart.rb
|
89
|
+
- lib/covered/brief_summary.rb
|
87
90
|
- lib/covered/capture.rb
|
88
91
|
- lib/covered/config.rb
|
89
92
|
- lib/covered/coverage.rb
|
@@ -91,6 +94,7 @@ files:
|
|
91
94
|
- lib/covered/forks.rb
|
92
95
|
- lib/covered/markdown_summary.rb
|
93
96
|
- lib/covered/minitest.rb
|
97
|
+
- lib/covered/partial_summary.rb
|
94
98
|
- lib/covered/persist.rb
|
95
99
|
- lib/covered/policy.rb
|
96
100
|
- lib/covered/rspec.rb
|
@@ -102,14 +106,14 @@ files:
|
|
102
106
|
- lib/covered/wrapper.rb
|
103
107
|
- license.md
|
104
108
|
- readme.md
|
105
|
-
|
109
|
+
- releases.md
|
110
|
+
homepage: https://github.com/socketry/covered
|
106
111
|
licenses:
|
107
112
|
- MIT
|
108
113
|
metadata:
|
109
|
-
documentation_uri: https://
|
114
|
+
documentation_uri: https://socketry.github.io/covered/
|
110
115
|
funding_uri: https://github.com/sponsors/ioquatix/
|
111
|
-
source_code_uri: https://github.com/
|
112
|
-
post_install_message:
|
116
|
+
source_code_uri: https://github.com/socketry/covered.git
|
113
117
|
rdoc_options: []
|
114
118
|
require_paths:
|
115
119
|
- lib
|
@@ -117,15 +121,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
117
121
|
requirements:
|
118
122
|
- - ">="
|
119
123
|
- !ruby/object:Gem::Version
|
120
|
-
version: '3.
|
124
|
+
version: '3.2'
|
121
125
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
126
|
requirements:
|
123
127
|
- - ">="
|
124
128
|
- !ruby/object:Gem::Version
|
125
129
|
version: '0'
|
126
130
|
requirements: []
|
127
|
-
rubygems_version: 3.
|
128
|
-
signing_key:
|
131
|
+
rubygems_version: 3.6.9
|
129
132
|
specification_version: 4
|
130
133
|
summary: A modern approach to code coverage.
|
131
134
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|