minitest-documentation 0.0.3 → 0.0.4
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 +4 -4
- data/lib/minitest/documentation.rb +26 -19
- data/lib/minitest/documentation_plugin.rb +5 -5
- data/minitest-documentation.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dec6b2d7fa607ee600072484f32f0d80253b90b8
|
4
|
+
data.tar.gz: ebd2945b00789c8e69263f6aee6c15d12e258ae3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b460e721becf923ab7d88f8956688d822d3d84e24cf7007c4e9b0a4de0397643dbb202bea22a23b2844f1485522f1a5fe5cc2c4e926640feef99e0cc765d4aa
|
7
|
+
data.tar.gz: d200be636df5cba7ffb1af5cb21b45a61917906e05767a89fe06e9c3de6cd58ccdee552231da10e8eab99e64173f8ccf9cd05a201c318999d60f0270e57b25fc
|
@@ -23,33 +23,40 @@ module Minitest
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def record result
|
26
|
-
output_klass_name result.class
|
27
|
-
|
26
|
+
output_klass_name result.class if self.class.documentation?
|
27
|
+
print_colorized_progress result if self.class.color?
|
28
28
|
|
29
|
-
if self.class.
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
when "E", "F"
|
34
|
-
RED
|
35
|
-
when "S"
|
36
|
-
YELLOW
|
37
|
-
end
|
38
|
-
io.print color_code
|
29
|
+
if self.class.documentation?
|
30
|
+
test = test_name result
|
31
|
+
io.print " "
|
32
|
+
io.puts stringify_test_name(test)
|
39
33
|
end
|
40
|
-
|
41
|
-
io.print " "
|
42
|
-
io.puts stringify_test_name(test)
|
43
34
|
io.print NND
|
44
35
|
end
|
45
36
|
|
46
37
|
private
|
47
|
-
|
38
|
+
|
39
|
+
def color_code result
|
40
|
+
color_code = case result.result_code
|
41
|
+
when "."
|
42
|
+
GREEN
|
43
|
+
when "E", "F"
|
44
|
+
RED
|
45
|
+
when "S"
|
46
|
+
YELLOW
|
47
|
+
end
|
48
|
+
color_code
|
49
|
+
end
|
50
|
+
|
51
|
+
def print_colorized_progress result
|
52
|
+
io.print color_code(result)
|
53
|
+
io.print result.result_code unless self.class.documentation?
|
54
|
+
end
|
48
55
|
|
49
56
|
def output_klass_name k
|
50
|
-
if k != klass
|
51
|
-
|
52
|
-
io.puts klass
|
57
|
+
if k != @klass
|
58
|
+
@klass = k
|
59
|
+
io.puts @klass
|
53
60
|
end
|
54
61
|
end
|
55
62
|
|
@@ -12,10 +12,10 @@ module Minitest
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.plugin_documentation_init options
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
if DocumentationReporter.documentation? || DocumentationReporter.color?
|
16
|
+
io = options.delete(:io) || $stdout
|
17
|
+
self.reporter.reporters.reject! {|o| o.is_a? ProgressReporter }
|
18
|
+
self.reporter.reporters << DocumentationReporter.new(io, options)
|
19
|
+
end
|
20
20
|
end
|
21
21
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-documentation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Teo Ljungberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|