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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f290d2966d836bdb4196974ec0cc30f9f959293
4
- data.tar.gz: bfea80e6ac93a50ae9b140fd4195bdbe059601ab
3
+ metadata.gz: dec6b2d7fa607ee600072484f32f0d80253b90b8
4
+ data.tar.gz: ebd2945b00789c8e69263f6aee6c15d12e258ae3
5
5
  SHA512:
6
- metadata.gz: e4e5ceb992a4c9541890639b833d6142361df5613287f6148a60365ffb6ee1f58a8d60cc55f881a48ae835dc18dad6310d8b9c8a5738d9b67e3a80df87a1a761
7
- data.tar.gz: d45e93ca06f31480a7156d1872364aaef93b8088a252ea7dd9289b4ef4fd5382664ee106156fdba2fedafc8350f3ab5b391afab1c782e079ff7d24d234cc24ad
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
- test = test_name result
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.color?
30
- color_code = case result.result_code
31
- when "."
32
- GREEN
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
- attr_accessor :klass
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
- self.klass = k
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
- return unless DocumentationReporter.documentation?
16
-
17
- io = options.delete(:io) || $stdout
18
- self.reporter.reporters.reject! {|o| o.is_a? ProgressReporter }
19
- self.reporter.reporters << DocumentationReporter.new(io, options)
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "minitest-documentation"
5
- spec.version = "0.0.3"
5
+ spec.version = "0.0.4"
6
6
  spec.authors = ["Teo Ljungberg"]
7
7
  spec.email = ["teo.ljungberg@gmail.com"]
8
8
  spec.summary = %q{Rspec like documentation for Minitest}
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.3
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-13 00:00:00.000000000 Z
11
+ date: 2014-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest