minitest-display 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -12,7 +12,7 @@ Needless to say, it's a work in progress.
12
12
 
13
13
  ## Requirements
14
14
 
15
- Requires Ruby 1.9 and the gem version of minitest >= 2.0.2
15
+ Requires Ruby 1.8.7 or 1.9 and the gem version of minitest >= 2.0.2
16
16
 
17
17
  ## Usage
18
18
 
@@ -18,57 +18,57 @@ end
18
18
 
19
19
  module MiniTest
20
20
  module Display
21
- VERSION = '0.0.4'
21
+ VERSION = '0.1.0'
22
22
 
23
23
  class << self
24
24
  def options
25
25
  @options ||= {
26
- suite_names: true,
27
- suite_divider: " | ",
28
- suite_time: true,
29
- color: true,
30
- wrap_at: 80,
31
- output_slow: 5,
32
- print: {
33
- success: '.',
34
- failure: 'F',
35
- error: 'E'
26
+ :suite_names => true,
27
+ :suite_divider => " | ",
28
+ :suite_time => true,
29
+ :color => true,
30
+ :wrap_at => 80,
31
+ :output_slow => 5,
32
+ :print => {
33
+ :success => '.',
34
+ :failure => 'F',
35
+ :error => 'E'
36
36
  },
37
- colors: {
38
- clear: 0,
39
- bold: 1,
40
- italics: 3,
41
- underline: 4,
42
- inverse: 9,
43
- strikethrough: 22,
44
- bold_off: 23,
45
- italics_off: 24,
46
- underline_off: 27,
47
- inverse_off: 29,
48
- strikethrough_off: 30,
49
- black: 30,
50
- red: 31,
51
- green: 32,
52
- yellow: 33,
53
- blue: 34,
54
- magenta: 35,
55
- cyan: 36,
56
- white: 37,
57
- default: 39,
58
- bg_black: 40,
59
- bg_red: 41,
60
- bg_green: 42,
61
- bg_yellow: 43,
62
- bg_blue: 44,
63
- bg_magenta: 45,
64
- bg_cyan: 46,
65
- bg_white: 47,
66
- bg_default: 49,
67
-
68
- suite: :clear,
69
- success: :green,
70
- failure: :red,
71
- error: :yellow
37
+ :colors => {
38
+ :clear => 0,
39
+ :bold => 1,
40
+ :italics => 3,
41
+ :underline => 4,
42
+ :inverse => 9,
43
+ :strikethrough => 22,
44
+ :bold_off => 23,
45
+ :italics_off => 24,
46
+ :underline_off => 27,
47
+ :inverse_off => 29,
48
+ :strikethrough_off => 30,
49
+ :black => 30,
50
+ :red => 31,
51
+ :green => 32,
52
+ :yellow => 33,
53
+ :blue => 34,
54
+ :magenta => 35,
55
+ :cyan => 36,
56
+ :white => 37,
57
+ :default => 39,
58
+ :bg_black => 40,
59
+ :bg_red => 41,
60
+ :bg_green => 42,
61
+ :bg_yellow => 43,
62
+ :bg_blue => 44,
63
+ :bg_magenta => 45,
64
+ :bg_cyan => 46,
65
+ :bg_white => 47,
66
+ :bg_default => 49,
67
+
68
+ :suite => :clear,
69
+ :success => :green,
70
+ :failure => :red,
71
+ :error => :yellow
72
72
  }
73
73
  }
74
74
  end
@@ -214,8 +214,11 @@ class MiniTest::Unit
214
214
 
215
215
  def status(io = self.output)
216
216
  format = "%d tests, %d assertions, %d failures, %d errors, %d skips"
217
- final_status = failures + errors > 0 ? :failure : :success
218
- io.puts display.color(format % [test_count, assertion_count, failures, errors, skips], [:bold, final_status])
217
+ final_status = if errors > 0 then :error
218
+ elsif failures > 0 then :failure
219
+ else :success
220
+ end
221
+ io.puts display.color(format % [test_count, assertion_count, failures, errors, skips], final_status)
219
222
 
220
223
  if display.options[:output_slow]
221
224
  @test_times.sort! {|a, b| b[1] <=> a[1] }
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "minitest-display"
8
- s.version = "0.0.4"
8
+ s.version = "0.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Aaron Quint"]
12
- s.date = "2011-12-26"
12
+ s.date = "2012-01-23"
13
13
  s.description = "Patches MiniTest to allow for an easily configurable output. For Ruby 1.9 :Datches MiniTest to allow for an easily configurable output. For Ruby 1.9 :D. Inspired by leftright, redgreen and other test output gems, with an emphasis on configuration and style"
14
14
  s.email = "aaron@quirkey.com"
15
15
  s.extra_rdoc_files = [
@@ -73,9 +73,9 @@ class TestMinitestDisplay < MiniTest::Unit::TestCase
73
73
  def test_runs_basic_test_suite_with_different_printing
74
74
  capture_test_output <<-TESTCASE
75
75
  MiniTest::Display.options = {
76
- suite_divider: ' // ',
77
- print: {
78
- success: 'PASS'
76
+ :suite_divider => ' // ',
77
+ :print => {
78
+ :success => 'PASS'
79
79
  }
80
80
  }
81
81
  class PrintTest < MiniTest::Unit::TestCase
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-display
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-26 00:00:00.000000000Z
12
+ date: 2012-01-23 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
16
- requirement: &70304961931880 !ruby/object:Gem::Requirement
16
+ requirement: &70333951123780 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.0.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70304961931880
24
+ version_requirements: *70333951123780
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: jeweler
27
- requirement: &70304961931260 !ruby/object:Gem::Requirement
27
+ requirement: &70333951122320 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.5.2
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70304961931260
35
+ version_requirements: *70333951122320
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: minitest
38
- requirement: &70304961930640 !ruby/object:Gem::Requirement
38
+ requirement: &70333951121000 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70304961930640
46
+ version_requirements: *70333951121000
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: minitest
49
- requirement: &70304961929960 !ruby/object:Gem::Requirement
49
+ requirement: &70333951117420 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '2.3'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70304961929960
57
+ version_requirements: *70333951117420
58
58
  description: Patches MiniTest to allow for an easily configurable output. For Ruby
59
59
  1.9 :Datches MiniTest to allow for an easily configurable output. For Ruby 1.9 :D.
60
60
  Inspired by leftright, redgreen and other test output gems, with an emphasis on
@@ -93,7 +93,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  segments:
95
95
  - 0
96
- hash: -3316932077744798741
96
+ hash: 1598493653742089202
97
97
  required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  none: false
99
99
  requirements: