turn-again-reporter 0.0.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +46 -16
- data/lib/version.rb +1 -1
- metadata +2 -3
- data/turn-again-reporter-0.0.1.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 968225fdfcb2e87c69f9b310bc938426610398b4
|
4
|
+
data.tar.gz: 4ad55c5b840f8ef438439255dc66aec7aea0f872
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d68946da7fe2038a2a4385856fec784cece4e802a3894272fbf101d2011cae7f64dd6f2b290e4aae911d0208d01d2067ffee878ec72e2604d602e49683a89ed
|
7
|
+
data.tar.gz: 0cc1564a0aff0f1a55f11af77b0fe7e8d0f9eb75575e2c126598869e29851992454a2c179bb512061840554f0488b49f0fa6d3b63c52a20e58eabfb5ee5bad0e
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,31 +1,61 @@
|
|
1
|
-
# Turn
|
1
|
+
# A Turn-like Minitest Reporter (Again)
|
2
2
|
|
3
|
-
|
3
|
+
One of my favorite aspects of the now-abandoned [turn gem](https://github.com/turn-project/turn)'s was how the status banners for each test (i.e. PASS, FAIL, ERROR, SKIP) lined up nicely on the right side, providing a comfy, at-a-glance view.
|
4
4
|
|
5
|
-
|
5
|
+
These days I'm using the [minitest-reporters](https://github.com/kern/minitest-reporters) gem everywhere, but I've felt a little picky about the SpecReporter's claims to be "Turn-like". Also, placing the status banners on the right side, after each test, has the undesirable effect of limiting the length of my test names.
|
6
|
+
|
7
|
+
**Q: Do I really need tests with 60-character names?**
|
8
|
+
*A: Yes, sometimes. And it's none of your business!*
|
9
|
+
|
10
|
+
This might be better off included in the minitest-reporters gem itself, but it varies so minimally/cosmetically from its parent that I can't bring myself to bother the wonderful [Alex Kern](https://github.com/kern) about it with a pull request. It's really just an easy way for me to spread this code across all my projects without copy-pasting it. If someone else out there enjoys this formatting, I'm glad to hear it.
|
6
11
|
|
7
|
-
|
12
|
+
## Usage and Features (so-called)
|
13
|
+
|
14
|
+
In your `test_helper.rb` file, or equivalent where you `require 'minitest-reporters'`, just follow it up with:
|
8
15
|
|
9
16
|
```ruby
|
10
|
-
|
17
|
+
require 'minitest/reporters'
|
18
|
+
|
19
|
+
Minitest::Reporters.use! Minitest::Reporters::TurnAgainReporter.new
|
20
|
+
```
|
21
|
+
|
22
|
+
TurnAgainReporter's initializer will pass on all existing Minitest::Reporters::Base keyword argments, such as `color: true` but uses two of its own for some customization:
|
23
|
+
|
24
|
+
1. The `indent` keyword can specify the indentation from the left of the console when running. The default is 4 to faithfully mimic turn itself.
|
25
|
+
2. *Unlike turn*, the duration measurements in next to the test status do not include hours, because the vast majority of tests do not require a whole hour for a single test case. However, hours can be re-enabled by passing the `:hours` keyword as `true`.
|
26
|
+
|
27
|
+
An example of these options:
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
|
31
|
+
Minitest::Reporters.use!(
|
32
|
+
Minitest::Reporters::TurnAgainReporter.new(
|
33
|
+
color: true, hours: true, indent: 2
|
34
|
+
))
|
11
35
|
```
|
12
36
|
|
13
|
-
|
37
|
+
## Installation
|
14
38
|
|
15
|
-
|
39
|
+
The usual gem installation applies:
|
16
40
|
|
17
|
-
|
41
|
+
```ruby
|
42
|
+
gem install 'turn-again-reporter'
|
43
|
+
```
|
18
44
|
|
19
|
-
|
45
|
+
Or in your Gemfile:
|
20
46
|
|
21
|
-
|
47
|
+
```ruby
|
48
|
+
gem 'turn-again-reporter'
|
49
|
+
```
|
22
50
|
|
23
|
-
|
51
|
+
and run
|
52
|
+
|
53
|
+
```bash
|
54
|
+
$ bundle install
|
55
|
+
```
|
24
56
|
|
25
57
|
## Contributing
|
26
58
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
31
|
-
5. Create a new Pull Request
|
59
|
+
Fork away, but I can't imaginee there's much to contribute.
|
60
|
+
|
61
|
+
That said, I would be interested to see how one might test the output of a test library? Play with redirecting STDOUT and write a few test cases for Fixnum or something? I would normally shy away from releasing untested code, but *honestly?!* This gem is just two `sprintf` statements and a re-arrangement of `puts` statements.
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turn-again-reporter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Kwiatkowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -76,7 +76,6 @@ files:
|
|
76
76
|
- Rakefile
|
77
77
|
- lib/minitest/reporters/turn_again_reporter.rb
|
78
78
|
- lib/version.rb
|
79
|
-
- turn-again-reporter-0.0.1.gem
|
80
79
|
- turn-again-reporter.gemspec
|
81
80
|
homepage: https://github.com/swifthand/turn-again-reporter
|
82
81
|
licenses:
|
Binary file
|