minitest-display 0.1.0 → 0.2.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/minitest/display.rb +20 -8
- data/minitest-display.gemspec +13 -20
- metadata +33 -31
data/lib/minitest/display.rb
CHANGED
@@ -29,6 +29,7 @@ module MiniTest
|
|
29
29
|
:color => true,
|
30
30
|
:wrap_at => 80,
|
31
31
|
:output_slow => 5,
|
32
|
+
:output_slow_suites => 5,
|
32
33
|
:print => {
|
33
34
|
:success => '.',
|
34
35
|
:failure => 'F',
|
@@ -168,7 +169,7 @@ class MiniTest::Unit
|
|
168
169
|
wrap_count = wrap_at
|
169
170
|
|
170
171
|
full_start_time = Time.now
|
171
|
-
@test_times ||= []
|
172
|
+
@test_times ||= Hash.new { |h, k| h[k] = [] }
|
172
173
|
assertions = suite.send("#{type}_methods").grep(filter).map { |method|
|
173
174
|
inst = suite.new method
|
174
175
|
inst._assertions = 0
|
@@ -179,7 +180,7 @@ class MiniTest::Unit
|
|
179
180
|
result = inst.run self
|
180
181
|
time = Time.now - @start_time
|
181
182
|
|
182
|
-
@test_times << ["#{suite}##{method}", time]
|
183
|
+
@test_times[suite] << ["#{suite}##{method}", time]
|
183
184
|
|
184
185
|
print "%.2f s = " % time if @verbose
|
185
186
|
print case result
|
@@ -220,12 +221,23 @@ class MiniTest::Unit
|
|
220
221
|
end
|
221
222
|
io.puts display.color(format % [test_count, assertion_count, failures, errors, skips], final_status)
|
222
223
|
|
223
|
-
if display.options[:output_slow]
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
224
|
+
display_slow_tests if display.options[:output_slow]
|
225
|
+
display_slow_suites if display.options[:output_slow_suites]
|
226
|
+
end
|
227
|
+
|
228
|
+
def display_slow_tests
|
229
|
+
times = @test_times.values.flatten(1).sort { |a, b| b[1] <=> a[1] }
|
230
|
+
puts "Slowest tests:"
|
231
|
+
times[0..display.options[:output_slow].to_i].each do |test_name, time|
|
232
|
+
puts "%.2f s\t#{test_name}" % time
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
def display_slow_suites
|
237
|
+
times = @test_times.map { |suite, tests| [suite, tests.map(&:last).sum] }.sort { |a, b| b[1] <=> a[1] }
|
238
|
+
puts "Slowest suites:"
|
239
|
+
times[0..display.options[:output_slow_suites].to_i].each do |suite, time|
|
240
|
+
puts "%.2f s\t#{suite}" % time
|
229
241
|
end
|
230
242
|
end
|
231
243
|
|
data/minitest-display.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "minitest-display"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.2.0.pre"
|
9
9
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Aaron Quint"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-12-08"
|
13
13
|
s.description = "Patches MiniTest to allow for an easily configurable output. For Ruby 1.9 :Datches MiniTest to allow for an easily configurable output. For Ruby 1.9 :D. Inspired by leftright, redgreen and other test output gems, with an emphasis on configuration and style"
|
14
14
|
s.email = "aaron@quirkey.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -33,32 +33,25 @@ Gem::Specification.new do |s|
|
|
33
33
|
s.homepage = "http://github.com/quirkey/minitest-display"
|
34
34
|
s.licenses = ["MIT"]
|
35
35
|
s.require_paths = ["lib"]
|
36
|
-
s.rubygems_version = "1.8.
|
36
|
+
s.rubygems_version = "1.8.23"
|
37
37
|
s.summary = "Patches MiniTest to allow for an easily configurable output. For Ruby 1.9 :D"
|
38
|
-
s.test_files = [
|
39
|
-
"test/helper.rb",
|
40
|
-
"test/test_minitest-display.rb"
|
41
|
-
]
|
42
38
|
|
43
39
|
if s.respond_to? :specification_version then
|
44
40
|
s.specification_version = 3
|
45
41
|
|
46
42
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
47
|
-
s.
|
48
|
-
s.add_development_dependency(%q<
|
49
|
-
s.add_development_dependency(%q<
|
50
|
-
s.add_runtime_dependency(%q<minitest>, ["~> 2.3"])
|
43
|
+
s.add_runtime_dependency(%q<minitest>, ["~> 4.3"])
|
44
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0"])
|
45
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.5"])
|
51
46
|
else
|
52
|
-
s.add_dependency(%q<
|
53
|
-
s.add_dependency(%q<
|
54
|
-
s.add_dependency(%q<
|
55
|
-
s.add_dependency(%q<minitest>, ["~> 2.3"])
|
47
|
+
s.add_dependency(%q<minitest>, ["~> 4.3"])
|
48
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
49
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5"])
|
56
50
|
end
|
57
51
|
else
|
58
|
-
s.add_dependency(%q<
|
59
|
-
s.add_dependency(%q<
|
60
|
-
s.add_dependency(%q<
|
61
|
-
s.add_dependency(%q<minitest>, ["~> 2.3"])
|
52
|
+
s.add_dependency(%q<minitest>, ["~> 4.3"])
|
53
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
54
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5"])
|
62
55
|
end
|
63
56
|
end
|
64
57
|
|
metadata
CHANGED
@@ -1,60 +1,64 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-display
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.0.pre
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Aaron Quint
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
16
|
-
requirement:
|
15
|
+
name: minitest
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
22
|
-
type: :
|
21
|
+
version: '4.3'
|
22
|
+
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '4.3'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
|
-
name:
|
27
|
-
requirement:
|
31
|
+
name: bundler
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ~>
|
31
36
|
- !ruby/object:Gem::Version
|
32
|
-
version: 1.
|
37
|
+
version: '1.0'
|
33
38
|
type: :development
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '1.0'
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
38
|
-
requirement:
|
47
|
+
name: jeweler
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
|
-
- -
|
51
|
+
- - ~>
|
42
52
|
- !ruby/object:Gem::Version
|
43
|
-
version: '
|
53
|
+
version: '1.5'
|
44
54
|
type: :development
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: minitest
|
49
|
-
requirement: &70333951117420 !ruby/object:Gem::Requirement
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
57
|
none: false
|
51
58
|
requirements:
|
52
59
|
- - ~>
|
53
60
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
55
|
-
type: :runtime
|
56
|
-
prerelease: false
|
57
|
-
version_requirements: *70333951117420
|
61
|
+
version: '1.5'
|
58
62
|
description: Patches MiniTest to allow for an easily configurable output. For Ruby
|
59
63
|
1.9 :Datches MiniTest to allow for an easily configurable output. For Ruby 1.9 :D.
|
60
64
|
Inspired by leftright, redgreen and other test output gems, with an emphasis on
|
@@ -93,20 +97,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
93
97
|
version: '0'
|
94
98
|
segments:
|
95
99
|
- 0
|
96
|
-
hash:
|
100
|
+
hash: 4169721688534295478
|
97
101
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
102
|
none: false
|
99
103
|
requirements:
|
100
|
-
- - ! '
|
104
|
+
- - ! '>'
|
101
105
|
- !ruby/object:Gem::Version
|
102
|
-
version:
|
106
|
+
version: 1.3.1
|
103
107
|
requirements: []
|
104
108
|
rubyforge_project:
|
105
|
-
rubygems_version: 1.8.
|
109
|
+
rubygems_version: 1.8.23
|
106
110
|
signing_key:
|
107
111
|
specification_version: 3
|
108
112
|
summary: Patches MiniTest to allow for an easily configurable output. For Ruby 1.9
|
109
113
|
:D
|
110
|
-
test_files:
|
111
|
-
- test/helper.rb
|
112
|
-
- test/test_minitest-display.rb
|
114
|
+
test_files: []
|