minitest-reporters 0.12.2 → 0.13.0

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.
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ end
15
15
  # The RubyMine reporter must be tested separately inside of RubyMine, and hence
16
16
  # is not run in the gallery. The JUnit reporter writes to `test/reports` instead
17
17
  # of having meaningful output. The guard reporter requires Guard, and I'm not
18
- # really all that intersted in setting it up for automated testing for such a
18
+ # really all that interested in setting it up for automated testing for such a
19
19
  # simple reporter.
20
20
  task :gallery do
21
21
  [
@@ -13,6 +13,8 @@ module MiniTest
13
13
 
14
14
  def initialize(options = {})
15
15
  @detailed_skip = options.fetch(:detailed_skip, true)
16
+ @slow_count = options.fetch(:slow_count, 0)
17
+ @test_times = []
16
18
  @color = options.fetch(:color) do
17
19
  output.tty? && (
18
20
  ENV["TERM"] == "screen" ||
@@ -29,7 +31,8 @@ module MiniTest
29
31
  end
30
32
 
31
33
  def before_test(suite, test)
32
- print "#{suite}##{test} = " if verbose?
34
+ @test_name = "#{suite}##{test}"
35
+ print "#{@test_name} = " if verbose?
33
36
  end
34
37
 
35
38
  def pass(suite, test, test_runner)
@@ -66,6 +69,18 @@ module MiniTest
66
69
  end
67
70
  end
68
71
 
72
+ if @slow_count > 0
73
+ slow_tests = @test_times.sort_by { |x| x[1] }.reverse.take(@slow_count)
74
+
75
+ puts
76
+ puts "Slowest tests:"
77
+ puts
78
+
79
+ slow_tests.each do |slow_test|
80
+ puts "%.6fs %s" % [slow_test[1], slow_test[0]]
81
+ end
82
+ end
83
+
69
84
  puts
70
85
  puts colored_for(suite_result, result_line)
71
86
  end
@@ -103,6 +118,7 @@ module MiniTest
103
118
 
104
119
  def after_test(result)
105
120
  time = Time.now - runner.test_start_time
121
+ @test_times << [@test_name, time]
106
122
 
107
123
  print '%.2f s = ' % time if verbose?
108
124
  print result
@@ -1,5 +1,5 @@
1
1
  module MiniTest
2
2
  module Reporters
3
- VERSION = "0.12.2"
3
+ VERSION = "0.13.0"
4
4
  end
5
5
  end
@@ -15,5 +15,5 @@ if ENV["REPORTER"]
15
15
  reporter_klass = MiniTest::Reporters.const_get(ENV["REPORTER"])
16
16
  MiniTest::Reporters.use! [reporter_klass.new]
17
17
  else
18
- MiniTest::Reporters.use!
18
+ MiniTest::Reporters.use!(MiniTest::Reporters::DefaultReporter.new)
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-reporters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.2
4
+ version: 0.13.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-13 00:00:00.000000000 Z
12
+ date: 2012-11-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -160,12 +160,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
160
160
  - - ! '>='
161
161
  - !ruby/object:Gem::Version
162
162
  version: '0'
163
+ segments:
164
+ - 0
165
+ hash: 1859525980406151277
163
166
  required_rubygems_version: !ruby/object:Gem::Requirement
164
167
  none: false
165
168
  requirements:
166
169
  - - ! '>='
167
170
  - !ruby/object:Gem::Version
168
171
  version: '0'
172
+ segments:
173
+ - 0
174
+ hash: 1859525980406151277
169
175
  requirements: []
170
176
  rubyforge_project: minitest-reporters
171
177
  rubygems_version: 1.8.24
@@ -179,4 +185,3 @@ test_files:
179
185
  - test/unit/minitest/extensible_backtrace_filter_test.rb
180
186
  - test/unit/minitest/reporter_test.rb
181
187
  - test/unit/minitest/reporters_test.rb
182
- has_rdoc: