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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 894b83d82e7bf198235f1cf78bdd65fde161bd8c0b4f1482222100f123cc77b7
4
- data.tar.gz: 14b98586d504f4517a37ecf72bd1da332476afc0cb3c0fc31f37e149a075ab69
3
+ metadata.gz: 9f46e0aa024886e79f3e5abc617aae0d6d448ab42d964bfdf4e81990c6830b89
4
+ data.tar.gz: 3b49cb9b7af3af68a9f39a7c37d4b90ab3e2d95424f76e092cd200a4b1b7b435
5
5
  SHA512:
6
- metadata.gz: 5f3764089e498187ff25b31a55814157aa3ad1ad6ef7ed354293934efbb43ff76e8fa356945f76dec6cb533d76bcd5b84f473867a6c07784ae8d66786b14db37
7
- data.tar.gz: 79f4295dda87d176f029e6acb93d3c140d31759e77ec1d0697ea65ba8567a542759af24ddd8a9d43cf10af97b6dd3665b178ad29a2bd61cc63c1fd8c802005cb
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 suppress output from tests. This plugin will buffer any output coming from a test going to STDOUT or STDERR, to make sure it doesn't interfere with the output of the test runner itself. By default, it will discard any output, unless the `--verbose` option is set. It also supports failing a test if it is writing anything to STDOUT or STDERR by setting the `--fail-on-output` command line option.
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, it will simply discard any output writting to `STDOUT` or `STDERR` by your tests.
18
- - When specifying `--verbose`, the output will be buffered and written to the `STDOUT` inside a box that makes clear what test the output originated from.
19
- - When running with the `--fail-on-output` option, a test will fail if it writes anything to either `STDOUT` or `STDERR`.
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/Shopifyminitest-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).
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
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Minitest
3
3
  module Silence
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.2"
5
5
  end
6
6
  end
@@ -37,6 +37,7 @@ module Minitest
37
37
  end
38
38
 
39
39
  result.output = output_thread.value
40
+ output_reader.close
40
41
  result
41
42
  end
42
43
  end
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.1
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-06-17 00:00:00.000000000 Z
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.1.2
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: []