minitest-red_green 0.9.1 → 0.9.2
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/red_green/plugin.rb +49 -0
- data/lib/minitest/red_green/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7883040db73e1f10862df2c62e1352acfc63a8cd
|
4
|
+
data.tar.gz: b3a752b435ca5838c4ea6e65d059d720217347df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84234768724a7a4d29d5f28004c9a1a158faab035fb0dcdcc81e38a25a63af36710bd0c2732d7d70820e92e93a65dd4447cff6eea84c0d30700711788b8136d1
|
7
|
+
data.tar.gz: 4f09e47e1567447eedb1868eb5690565635e1dc72f7b5936876a90f78f7c667059050fde3caa4bb78003ed81fe684957c95ca1d49cd10f5eec0a4c4df4199e77
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module Minitest
|
2
|
+
module RedGreen
|
3
|
+
class Plugin
|
4
|
+
attr_accessor :sync
|
5
|
+
|
6
|
+
ESC = "\e["
|
7
|
+
|
8
|
+
def initialize io
|
9
|
+
@io = io
|
10
|
+
end
|
11
|
+
|
12
|
+
def puts *strings
|
13
|
+
if not strings.grep(%r{\d+\) (?:Failure|Error)}).empty?
|
14
|
+
strings.map! &method(:red)
|
15
|
+
end
|
16
|
+
@io.puts *strings
|
17
|
+
end
|
18
|
+
|
19
|
+
def print str
|
20
|
+
@io.print filter_test_output_chars str
|
21
|
+
end
|
22
|
+
|
23
|
+
def filter_test_output_chars str
|
24
|
+
case str
|
25
|
+
when '.' then green str
|
26
|
+
when 'E', 'F' then red str
|
27
|
+
when 'S' then yellow str
|
28
|
+
else str
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def green str
|
33
|
+
colorize str, 32
|
34
|
+
end
|
35
|
+
|
36
|
+
def red str
|
37
|
+
colorize str, 31
|
38
|
+
end
|
39
|
+
|
40
|
+
def yellow str
|
41
|
+
colorize str, 33
|
42
|
+
end
|
43
|
+
|
44
|
+
def colorize str, col_code
|
45
|
+
"#{ESC}#{col_code}m#{str}#{ESC}0m"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-red_green
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ntl
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- bin/rake
|
68
68
|
- bin/test_runner
|
69
69
|
- lib/minitest/red_green.rb
|
70
|
+
- lib/minitest/red_green/plugin.rb
|
70
71
|
- lib/minitest/red_green/version.rb
|
71
72
|
- lib/minitest/red_green_plugin.rb
|
72
73
|
- minitest-red_green.gemspec
|
@@ -98,6 +99,7 @@ summary: Adds red/green colors to standard minitest output
|
|
98
99
|
test_files:
|
99
100
|
- bin/test_runner
|
100
101
|
- lib/minitest/red_green.rb
|
102
|
+
- lib/minitest/red_green/plugin.rb
|
101
103
|
- lib/minitest/red_green/version.rb
|
102
104
|
- lib/minitest/red_green_plugin.rb
|
103
105
|
- minitest-red_green.gemspec
|