minitest-reporters 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06177a8caff2d0f38b5c21fdb58d4012de8ab796
4
- data.tar.gz: 2ba0a7fe3f56ccf8100307da50f2f4424ed7d47e
3
+ metadata.gz: 407feb8fed7084f2c0d0af4e07a9b4724c25ee1d
4
+ data.tar.gz: fd92d41b73c5d644d90d0c04068e3b9da6b03156
5
5
  SHA512:
6
- metadata.gz: a4be47d313c036594919269a4cd10e22e95d66875a59fabe26a71c2e9b4a4aa5f9347aafceb4f373387a40a5dec754559339b71beb5dbf08481d50cc9a89b834
7
- data.tar.gz: 6aed137329cd1bc269463cea0f4dba27c51d3ccaf7be9d413636e219b551fdd8dda7cd64f05fa2cca2f4f4e73e18e58d01e94a9fd347427912449565a532db8a
6
+ metadata.gz: 7f69b153445c9c74fd98bdc69e19a6d8f5348d6db388c9dbca42b49b3e8345ac2cb652e616ff9eae7859e996aecc3cf6cca7be324ca88683663bda59ceeba755
7
+ data.tar.gz: 13ff07c33e2c98bb080b58c2ad6473eb2a8b4ec4577be165f81e21cbeffdd5d4399a07c0ef8d8ec9082fe1c5f41dbdf15825e372b919fc4620d3dc3b02ab7eb0
data/README.md CHANGED
@@ -65,6 +65,29 @@ Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(:color => tru
65
65
 
66
66
  If you are using minitest-reporters with ActiveSupport 3.x, make sure that you require ActiveSupport before invoking `Minitest::Reporters.use!`. Minitest-reporters fixes incompatibilities caused by monkey patches in ActiveSupport 3.x. ActiveSupport 4.x is unaffected.
67
67
 
68
+ **Rails Backtrace Filtering and Custom Backtrace Filtering**
69
+
70
+ Minitest lets you configures your own, custom backtrace filter via
71
+ `Minitest.backtrace_filter=`. If you're using Rails, then by default
72
+ `Minitest.backtrace_filter` is a filter designed specially for Rails.
73
+
74
+ But minitest-reporters overwrites `Minitest.backtrace_filter` by default. That means it
75
+ will overwrite your custom filter and Rails' default filter. (You'll know this is
76
+ happening if you see overly long or otherwise unexpected backtraces.)
77
+
78
+ To avoid that, you must manually tell minitest-reporters which filter to use. In Rails,
79
+ do this in `test_helper.rb`:
80
+
81
+ Minitest::Reporters.use!(
82
+ Minitest::Reporters::DefaultReporter.new,
83
+ ENV,
84
+ Minitest.backtrace_filter
85
+ )
86
+
87
+ The third parameter to `.new`, in this case `Minitest.backtrace_filter`, should be a
88
+ filter object. In the above example, you're telling minitest-reporters to use the filter
89
+ that Rails has already set.
90
+
68
91
  ## Note on Patches/Pull Requests ##
69
92
 
70
93
  * Fork the project.
@@ -1,7 +1,6 @@
1
1
  module Minitest
2
2
  module Reporters
3
3
  class BaseReporter < Minitest::StatisticsReporter
4
- attr_accessor :total_count
5
4
  attr_accessor :tests
6
5
 
7
6
  def initialize(options={})
@@ -25,7 +25,7 @@ module Minitest
25
25
  def start
26
26
  super
27
27
  puts
28
- puts "# Running tests:"
28
+ puts("# Running tests with run options %s:" % options[:args])
29
29
  puts
30
30
  end
31
31
 
@@ -41,7 +41,8 @@ module Minitest
41
41
 
42
42
  def after_suite(suite)
43
43
  super
44
- @suite_times << [suite.name, Time.now - @suite_start_times.delete(suite)]
44
+ duration = suite_duration(suite)
45
+ @suite_times << [suite.name, duration]
45
46
  end
46
47
 
47
48
  def record(test)
@@ -194,6 +195,15 @@ module Minitest
194
195
  '%d tests, %d assertions, %d failures, %d errors, %d skips' %
195
196
  [count, assertions, failures, errors, skips]
196
197
  end
198
+
199
+ def suite_duration(suite)
200
+ start_time = @suite_start_times.delete(suite)
201
+ if start_time.nil?
202
+ 0
203
+ else
204
+ Time.now - start_time
205
+ end
206
+ end
197
207
  end
198
208
  end
199
209
  end
@@ -32,7 +32,7 @@ module Minitest
32
32
 
33
33
  def start
34
34
  super
35
- puts 'Started'
35
+ puts('Started with run options %s' % options[:args])
36
36
  puts
37
37
  @progress.start
38
38
  @progress.total = total_count
@@ -10,7 +10,7 @@ module Minitest
10
10
 
11
11
  def start
12
12
  super
13
- puts 'Started'
13
+ puts('Started with run options %s' % options[:args])
14
14
  puts
15
15
  end
16
16
 
@@ -34,7 +34,7 @@ else
34
34
 
35
35
  def start
36
36
  super
37
- puts 'Started'
37
+ puts('Started with run options %s' % options[:args])
38
38
  puts
39
39
 
40
40
  # Setup test runner's MessageFactory
@@ -14,7 +14,7 @@ module Minitest
14
14
 
15
15
  def start
16
16
  super
17
- puts 'Started'
17
+ puts('Started with run options %s' % options[:args])
18
18
  puts
19
19
  end
20
20
 
@@ -1,5 +1,5 @@
1
1
  module Minitest
2
2
  module Reporters
3
- VERSION = '1.0.5'
3
+ VERSION = '1.0.6'
4
4
  end
5
5
  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.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-05 00:00:00.000000000 Z
11
+ date: 2014-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest