minitest-silence 0.2.1 → 0.2.2
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
- data/README.md +13 -5
- data/lib/minitest/silence/version.rb +1 -1
- data/lib/minitest/silence_plugin.rb +1 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f46e0aa024886e79f3e5abc617aae0d6d448ab42d964bfdf4e81990c6830b89
|
4
|
+
data.tar.gz: 3b49cb9b7af3af68a9f39a7c37d4b90ab3e2d95424f76e092cd200a4b1b7b435
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78e574ada8ebd7508c983fd82ae23de9e9ac265558297ae33f816907930d23c08cefb4448d7840c994b77624f4041f541db5e2a451fe715282f125f9d9418a63
|
7
|
+
data.tar.gz: ed262141df222aedcba0ac04db78244df3ccde2e57b5304549311cf27b70647b29eb220e600aba9b187760e3745329c118ac1382bda6d9c5a7e0e4e2b89c2fa4
|
data/README.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
# Minitest::Silence
|
2
2
|
|
3
|
-
Minitest plugin to
|
3
|
+
Minitest plugin to capture output to stdout and stderr from tests.
|
4
|
+
|
5
|
+
It's best practice for tests to not write anything to `STDOUT` or `STDERR` while running. Besides it being an implicit dependency, it interferes with the output from the test runner. Even though this is a best practice, when your test suite grows large enough, it becomes almost impossible to make sure every test conforms to this best practice.
|
6
|
+
|
7
|
+
This plugins aims to solve this problem by rebinding `STDOUT` and `STDERR` while a test is running. Any output written will be redirected to a pipe, so it won't interfere with the output of the test runner. The plugin will also bind `STDIN` to `/dev/null`. This codifies the best practice that automated tests should not depend on user input.
|
8
|
+
|
9
|
+
This plugin is inspired by [how the Python test runner handles output](https://docs.pytest.org/en/stable/capture.html).
|
4
10
|
|
5
11
|
## Installation
|
6
12
|
|
@@ -14,9 +20,11 @@ gem 'minitest-silence', require: false
|
|
14
20
|
|
15
21
|
The plugin will be automatically activated by Minitest if it is in your application's bundle.
|
16
22
|
|
17
|
-
- By default,
|
18
|
-
-
|
19
|
-
-
|
23
|
+
- By default, the captured output produced by tests will be discarded, so the output of the test runner will look like how it was intended.
|
24
|
+
- If you run tests with the `--verbose` option , it will be nicely included in the test runner's output, inside a box that will tell you what test it originated from.
|
25
|
+
- You can also run this plugin in "strict mode": by running tests with the `--fail-on-output` option, tests will fail if they produce any output to STDOUT or STDERR.
|
26
|
+
|
27
|
+
You can disable the plugin by providing the `--disable-silence` command line option to your test invocation. The primary use case for this is when you want to use a debugger inside a test, which will require a the standard input and outputs to work interactively.
|
20
28
|
|
21
29
|
## Development
|
22
30
|
|
@@ -26,7 +34,7 @@ To install this gem onto your local machine, run `bin/rake install`. To release
|
|
26
34
|
|
27
35
|
## Contributing
|
28
36
|
|
29
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
37
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/Shopify/minitest-silence. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/Shopify/minitest-silence/blob/master/CODE_OF_CONDUCT.md).
|
30
38
|
|
31
39
|
## License
|
32
40
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-silence
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Willem van Bergen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -61,7 +61,7 @@ metadata:
|
|
61
61
|
allowed_push_host: https://rubygems.org
|
62
62
|
homepage_uri: https://github.com/Shopify/minitest-silence
|
63
63
|
source_code_uri: https://github.com/Shopify/minitest-silence
|
64
|
-
post_install_message:
|
64
|
+
post_install_message:
|
65
65
|
rdoc_options: []
|
66
66
|
require_paths:
|
67
67
|
- lib
|
@@ -76,8 +76,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0'
|
78
78
|
requirements: []
|
79
|
-
rubygems_version: 3.
|
80
|
-
signing_key:
|
79
|
+
rubygems_version: 3.0.3
|
80
|
+
signing_key:
|
81
81
|
specification_version: 4
|
82
82
|
summary: Minitest plugin to suppress output from tests.
|
83
83
|
test_files: []
|