minitest-red_green 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f767a35feb2b4140858612016de97ff005b66701
4
- data.tar.gz: 1789ce356738eb9835b80b4993773861a8bd1301
3
+ metadata.gz: 7883040db73e1f10862df2c62e1352acfc63a8cd
4
+ data.tar.gz: b3a752b435ca5838c4ea6e65d059d720217347df
5
5
  SHA512:
6
- metadata.gz: 02e90c93b7214fabf3326991d1e533090553178d57d8fface8ab14f71c99187163242b781faa29ec0eeceae735bfc8bbccf0c34a33e669173b68d461cc559cea
7
- data.tar.gz: e40bb5c141a7f5d550115b9a75ead5be1c3b82565e9477204f397ff9262b1d0ae58dda217cbe0da6888da12da7417e7368bc72ad1fad23c000bbc4c394a213f2
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
@@ -1,5 +1,5 @@
1
1
  module Minitest
2
2
  module RedGreen
3
- VERSION = "0.9.1"
3
+ VERSION = "0.9.2"
4
4
  end
5
5
  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.1
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