minitest-reporters 1.0.16 → 1.0.17

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
  SHA1:
3
- metadata.gz: 8e8012319da3c148b79e60a70dc219ae3b6132e3
4
- data.tar.gz: 1ce365d41b77f265495f86c63254b421a1321a81
3
+ metadata.gz: b5094e1d99a4234ba4c8ccdb75620d40c5a76a7e
4
+ data.tar.gz: c30a0b3b3f40ab0953fd5feda3d0721afa0b2660
5
5
  SHA512:
6
- metadata.gz: 9dbfabfc58cf28bc5e527cd1bfbcdc09eb3d4b22864bee0b18597fa4a1176dc54c3810ce29d83c9a7557ae29c0bca57451dd39dd91602f12702f92c23e70dd10
7
- data.tar.gz: 6a5e8258bdb4946b3d58ebdf912e8a7dc750991c851684f5a3d2d6a16bd4764be2b5dd29760810aa8b1bc3562eb95f35e01b6e2419e4600a9f2f81ae65793492
6
+ metadata.gz: 317881d29f0b6aa0bd0a66ce2ac8b6bd127557f2221174a117937924f18ca67e7e9dd0b49f2c57f97084ac6eebf22149c167ea7aadf492853dfaea144e51239a
7
+ data.tar.gz: 6c7a4da3bea948f5ad61f9998cfa717dd061b2da3fefc54bbfa7f3566181a56b08f0f81f8ad039fb2aa3dc5af4f70b9240b90d6c115c0427224082e27ea12fca
data/README.md CHANGED
@@ -1,4 +1,9 @@
1
- # minitest-reporters - create customizable Minitest output formats [![Build Status](https://secure.travis-ci.org/kern/minitest-reporters.png)](http://travis-ci.org/kern/minitest-reporters)
1
+ [gem]: https://rubygems.org/gems/minitest-reporters
2
+ [travis]: https://travis-ci.org/rom-rb/rom-mongo
3
+
4
+ # minitest-reporters - create customizable Minitest output formats
5
+ [![Gem Version](https://badge.fury.io/rb/minitest-reporters.svg)][gem]
6
+ [![Build Status](https://secure.travis-ci.org/kern/minitest-reporters.png)][travis]
2
7
 
3
8
  Death to haphazard monkey-patching! Extend Minitest through simple hooks.
4
9
 
@@ -50,6 +50,7 @@ module Minitest
50
50
 
51
51
  print "#{"%.2f" % test.time} = " if options[:verbose]
52
52
 
53
+ # Print the pass/skip/fail mark
53
54
  print(if test.passed?
54
55
  record_pass(test)
55
56
  elsif test.skipped?
@@ -58,8 +59,8 @@ module Minitest
58
59
  record_failure(test)
59
60
  end)
60
61
 
62
+ # Print fast_fail information
61
63
  if @fast_fail && (test.skipped? || test.failure)
62
- puts
63
64
  print_failure(test)
64
65
  end
65
66
  end
@@ -84,10 +85,10 @@ module Minitest
84
85
  puts
85
86
  puts
86
87
  puts colored_for(suite_result, status_line)
88
+ puts
87
89
 
88
90
  unless @fast_fail
89
91
  tests.reject(&:passed?).each do |test|
90
- puts
91
92
  print_failure(test)
92
93
  end
93
94
  end
@@ -124,7 +125,11 @@ module Minitest
124
125
  alias to_s report
125
126
 
126
127
  def print_failure(test)
127
- puts colored_for(result(test), message_for(test))
128
+ message = message_for(test)
129
+ unless message.nil? || message.strip == ''
130
+ puts
131
+ puts colored_for(result(test), message)
132
+ end
128
133
  end
129
134
 
130
135
  private
@@ -28,9 +28,10 @@ module Minitest
28
28
 
29
29
  def record(test)
30
30
  super
31
+ test.name.gsub!(/^test_:/, 'test:')
31
32
  print pad_test(test.name)
32
33
  print_colored_status(test)
33
- print(" (%.2fs)" % test.time)
34
+ print(" (%.2fs)" % test.time) unless test.time.nil?
34
35
  puts
35
36
  if !test.skipped? && test.failure
36
37
  print_info(test.failure)
@@ -1,5 +1,5 @@
1
1
  module Minitest
2
2
  module Reporters
3
- VERSION = '1.0.16'
3
+ VERSION = '1.0.17'
4
4
  end
5
5
  end
@@ -0,0 +1,27 @@
1
+ require_relative "../../test_helper"
2
+
3
+ module MinitestReportersTest
4
+ class SpecReporterTest < Minitest::Test
5
+ def setup
6
+ @reporter = Minitest::Reporters::SpecReporter.new
7
+ @test = Minitest::Test.new("")
8
+ @test.time = 0
9
+ end
10
+
11
+ def test_removes_underscore_in_name_if_shoulda
12
+ @test.name = "test_: Should foo"
13
+ assert_output /test:/ do
14
+ @reporter.io = $stdout
15
+ @reporter.record(@test)
16
+ end
17
+ end
18
+
19
+ def test_wont_modify_name_if_not_shoulda
20
+ @test.name = "test_foo"
21
+ assert_output /test_foo/ do
22
+ @reporter.io = $stdout
23
+ @reporter.record(@test)
24
+ end
25
+ end
26
+ end
27
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-reporters
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.16
4
+ version: 1.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-13 00:00:00.000000000 Z
11
+ date: 2015-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -138,6 +138,7 @@ files:
138
138
  - test/test_helper.rb
139
139
  - test/unit/minitest/extensible_backtrace_filter_test.rb
140
140
  - test/unit/minitest/reporters_test.rb
141
+ - test/unit/minitest/spec_reporter_test.rb
141
142
  homepage: https://github.com/CapnKernul/minitest-reporters
142
143
  licenses: []
143
144
  metadata: {}
@@ -173,3 +174,4 @@ test_files:
173
174
  - test/test_helper.rb
174
175
  - test/unit/minitest/extensible_backtrace_filter_test.rb
175
176
  - test/unit/minitest/reporters_test.rb
177
+ - test/unit/minitest/spec_reporter_test.rb