minitest-red_green 0.9.0 → 0.9.1

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: 90db92c701ea6b15b2e5d95660fc3eb949e01389
4
- data.tar.gz: 6ad5902662868bba4aecc031f61b46926b2b88b0
3
+ metadata.gz: f767a35feb2b4140858612016de97ff005b66701
4
+ data.tar.gz: 1789ce356738eb9835b80b4993773861a8bd1301
5
5
  SHA512:
6
- metadata.gz: dd03d91bde972ea74be4d546f7d81a36c346343298ac71861fb7e191ee925f617a1ceba1b39cd9feb61322885fd1f6b3074a1a6647051632f912fc9e38caf2df
7
- data.tar.gz: cb61125e4e289937f473d1bfa2bec28a4a978c7481ad388ddcfadddbb4b6c636c4820275fb03c0e93f0f2b59f3b56e0290528ae56902890e96aaa53786bafb33
6
+ metadata.gz: 02e90c93b7214fabf3326991d1e533090553178d57d8fface8ab14f71c99187163242b781faa29ec0eeceae735bfc8bbccf0c34a33e669173b68d461cc559cea
7
+ data.tar.gz: e40bb5c141a7f5d550115b9a75ead5be1c3b82565e9477204f397ff9262b1d0ae58dda217cbe0da6888da12da7417e7368bc72ad1fad23c000bbc4c394a213f2
data/README.md CHANGED
@@ -10,6 +10,13 @@ Add this line to your application's Gemfile:
10
10
  gem 'minitest-red_green'
11
11
  ```
12
12
 
13
+ Or your gem's gemspec:
14
+
15
+ ```ruby
16
+ spec.add_development_dependency 'minitest'
17
+ spec.add_development_dependency 'minitest-red_green'
18
+ ```
19
+
13
20
  And then execute:
14
21
 
15
22
  $ bundle
@@ -23,7 +30,7 @@ Or install it yourself as:
23
30
  Once you add this gem to your `Gemfile`, minitest should start printing out red and green colors. If you wish to disable this for some reason,
24
31
 
25
32
  ```ruby
26
- Minitest::RedGreenPlugin.disabled = true
33
+ Minitest::RedGreen.disabled = true
27
34
  ```
28
35
 
29
36
  Although, it's probably much simpler to simply remove this gem from your `Gemfile` in the first place :)
data/bin/test_runner CHANGED
@@ -8,7 +8,7 @@ require 'minitest'
8
8
 
9
9
  load 'test/red_green_test.rb'
10
10
 
11
- Minitest::RedGreenPlugin.disabled = ENV['TEST_DISABLE']
11
+ Minitest::RedGreen.disabled = ENV['TEST_DISABLE']
12
12
 
13
13
  passed = Minitest.run
14
14
  exit passed ? 0 : 1
@@ -1,5 +1,5 @@
1
1
  module Minitest
2
2
  module RedGreen
3
- VERSION = "0.9.0"
3
+ VERSION = "0.9.1"
4
4
  end
5
5
  end
@@ -1,2 +1,10 @@
1
+ require_relative 'red_green/plugin'
1
2
  require_relative 'red_green/version'
2
3
  require_relative 'red_green_plugin'
4
+
5
+ module Minitest
6
+ module RedGreen
7
+ extend self
8
+ attr_accessor :disabled
9
+ end
10
+ end
@@ -1,57 +1,9 @@
1
1
  module Minitest
2
2
  def self.plugin_red_green_init options
3
- return if RedGreenPlugin.disabled
3
+ return if RedGreen.disabled
4
4
  reporters = self.reporter.reporters.grep Minitest::Reporter
5
5
  reporters.each do |reporter|
6
- reporter.io = RedGreenPlugin.new options[:io]
7
- end
8
- end
9
-
10
- class RedGreenPlugin
11
- singleton_class.send :attr_accessor, :disabled
12
-
13
- attr_accessor :sync
14
-
15
- ESC = "\e["
16
-
17
- def initialize io
18
- @io = io
19
- end
20
-
21
- def puts *strings
22
- if not strings.grep(%r{\d+\) (?:Failure|Error)}).empty?
23
- strings.map! &method(:red)
24
- end
25
- @io.puts *strings
26
- end
27
-
28
- def print str
29
- @io.print filter_test_output_chars str
30
- end
31
-
32
- def filter_test_output_chars str
33
- case str
34
- when '.' then green str
35
- when 'E', 'F' then red str
36
- when 'S' then yellow str
37
- else str
38
- end
39
- end
40
-
41
- def green str
42
- colorize str, 32
43
- end
44
-
45
- def red str
46
- colorize str, 31
47
- end
48
-
49
- def yellow str
50
- colorize str, 33
51
- end
52
-
53
- def colorize str, col_code
54
- "#{ESC}#{col_code}m#{str}#{ESC}0m"
6
+ reporter.io = RedGreen::Plugin.new options[:io]
55
7
  end
56
8
  end
57
9
  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.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ntl