minitest-reporters 1.0.2 → 1.0.3

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: d3298c9d312842536089c1b0859178bd9c4815c2
4
- data.tar.gz: 0922785aded67f90bea9550a903bd924d8f975b8
3
+ metadata.gz: 05d45de95aebdd43a75b94d51b6cf93e267150f2
4
+ data.tar.gz: d30f23b6c4eb9583a691eb2fddbebc3464d37ede
5
5
  SHA512:
6
- metadata.gz: f27a5e9e92d9a235bb48f1c7dca4ac2c61f25e2810dc3242a7a09288248663c40dadfbca9d83007ef02b513b89d8aaf9874b94125cc10dbe84b94e2fffb79c48
7
- data.tar.gz: b0727acc1c8d5d870ccd17fae5f8bf5aae83f6e2561eaa6c684f45dca884c1580bbe033dc44ae43bee208bdfc071a6560fbfe5b639ca05b6e48000204ae220bc
6
+ metadata.gz: d5d479974d16b0e3763647e9174131178ac3e537a18f740d4e3de3801add54971517880262479beb5c29728bdd321f4a7677df2d7c15218d3b97e41d0e72169d
7
+ data.tar.gz: cfd92d468e6603a4d7a2b70781d00973a76848bc88dd6d17c466ef460a2beb6466b1b80ea2a3de5e76944a4dc88637ee523e71f43ca958fb9b17fd6bbd1cb140
data/.gitignore CHANGED
@@ -22,3 +22,5 @@ doc/
22
22
  # Gem-specific
23
23
  Gemfile.lock
24
24
  .idea/
25
+ .ruby-version
26
+
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # minitest-reporters - create customizable Minitest output formats [![Build Status](https://secure.travis-ci.org/axskern/minitest-reporters.png)](http://travis-ci.org/axskern/minitest-reporters)
1
+ # minitest-reporters - create customizable Minitest output formats [![Build Status](https://secure.travis-ci.org/kern/minitest-reporters.png)](http://travis-ci.org/kern/minitest-reporters)
2
2
 
3
3
  Death to haphazard monkey-patching! Extend Minitest through simple hooks.
4
4
 
@@ -44,7 +44,7 @@ Options can be passed to these reporters at construction-time, e.g. to force
44
44
  color output from `DefaultReporter`:
45
45
 
46
46
  ```ruby
47
- Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new(:color => true)]
47
+ Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(:color => true)]
48
48
  ```
49
49
 
50
50
  ## Screenshots ##
@@ -1,5 +1,5 @@
1
1
  require 'ansi/code'
2
- require 'powerbar'
2
+ require 'ruby-progressbar'
3
3
 
4
4
  module Minitest
5
5
  module Reporters
@@ -14,31 +14,34 @@ module Minitest
14
14
  include RelativePosition
15
15
  include ANSI::Code
16
16
 
17
- INFO_PADDING = 2
17
+ PROGRESS_MARK = '='
18
18
 
19
19
  def initialize(options = {})
20
20
  super
21
21
  @detailed_skip = options.fetch(:detailed_skip, true)
22
22
 
23
- @progress = PowerBar.new(:msg => "0/#{count}")
24
- @progress.settings.tty.finite.output = lambda { |s| print(s) }
25
- @progress.settings.tty.finite.template.barchar = "="
26
- @progress.settings.tty.finite.template.padchar = " "
27
- @progress.settings.tty.finite.template.pre = "\e[1000D#{GREEN}"
28
- @progress.settings.tty.finite.template.post = CLEAR
23
+ @progress = ProgressBar.create({
24
+ total: total_count,
25
+ starting_at: count,
26
+ progress_mark: green(PROGRESS_MARK),
27
+ remainder_mark: ' ',
28
+ format: ' %C/%c: [%B] %p%% %a, %e',
29
+ autostart: false
30
+ })
29
31
  end
30
32
 
31
33
  def start
32
34
  super
33
35
  puts 'Started'
34
36
  puts
37
+ @progress.start
35
38
  show
36
39
  end
37
40
 
38
41
  def record(test)
39
42
  super
40
43
  if (test.skipped? && @detailed_skip) || test.failure
41
- wipe
44
+ print "\e[0m\e[1000D\e[K"
42
45
  print_colored_status(test)
43
46
  print_test_with_time(test)
44
47
  puts
@@ -46,10 +49,10 @@ module Minitest
46
49
  puts
47
50
  end
48
51
 
49
- if test.skipped? && color != RED
50
- self.color = YELLOW
52
+ if test.skipped? && color != "red"
53
+ self.color = "yellow"
51
54
  elsif test.failure
52
- self.color = RED
55
+ self.color = "red"
53
56
  end
54
57
 
55
58
  show
@@ -57,9 +60,8 @@ module Minitest
57
60
 
58
61
  def report
59
62
  super
60
- @progress.close
63
+ @progress.finish
61
64
 
62
- wipe
63
65
  puts
64
66
  puts('Finished in %.5fs' % total_time)
65
67
  print('%d tests, %d assertions, ' % [count, assertions])
@@ -73,29 +75,22 @@ module Minitest
73
75
  def show
74
76
  return if count == 0
75
77
 
76
- @progress.show({
77
- :msg => "#{total_count}/#{count}",
78
- :done => count,
79
- :total => total_count,
80
- }, true)
81
- end
82
-
83
- def wipe
84
- @progress.wipe
78
+ @progress.total = total_count
79
+ @progress.increment
85
80
  end
86
81
 
87
82
  def print_test_with_time(test)
88
- puts [test.name, test.class, total_time, ENDCODE].inspect
89
- print(" %s#%s (%.2fs)%s" % [test.name, test.class, total_time, ENDCODE])
83
+ puts [test.name, test.class, total_time].inspect
84
+ print(" %s#%s (%.2fs)" % [test.name, test.class, total_time])
90
85
  end
91
86
 
92
87
  def color
93
- @color ||= GREEN
88
+ @color ||= "green"
94
89
  end
95
90
 
96
91
  def color=(color)
97
92
  @color = color
98
- @progress.scope.template.pre = "\e[1000D#{@color}"
93
+ @progress.progress_mark = send(color, PROGRESS_MARK)
99
94
  end
100
95
  end
101
96
  end
@@ -34,7 +34,7 @@ module Minitest
34
34
  print_colored_status(test)
35
35
  print(" (%.2fs)" % test.time)
36
36
  puts
37
- if test.failure
37
+ if !test.skipped? && test.failure
38
38
  print_info(test.failure)
39
39
  puts
40
40
  end
@@ -1,5 +1,5 @@
1
1
  module Minitest
2
2
  module Reporters
3
- VERSION = '1.0.2'
3
+ VERSION = '1.0.3'
4
4
  end
5
5
  end
@@ -1,4 +1,8 @@
1
- require "minitest/unit"
1
+ begin
2
+ require "minitest/autorun"
3
+ rescue
4
+ require "minitest/unit"
5
+ end
2
6
 
3
7
  module Minitest
4
8
  require "minitest/relative_position"
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
16
16
 
17
17
  s.add_dependency 'minitest', '>= 5.0'
18
18
  s.add_dependency 'ansi'
19
- s.add_dependency 'powerbar'
19
+ s.add_dependency 'ruby-progressbar'
20
20
  s.add_dependency 'builder'
21
21
 
22
22
  s.add_development_dependency 'maruku'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-reporters
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-28 00:00:00.000000000 Z
11
+ date: 2014-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: powerbar
42
+ name: ruby-progressbar
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '>='
@@ -103,7 +103,6 @@ extra_rdoc_files: []
103
103
  files:
104
104
  - .gitignore
105
105
  - .ruby-gemset
106
- - .ruby-version
107
106
  - .travis.yml
108
107
  - .yardopts
109
108
  - Gemfile
@@ -157,4 +156,11 @@ rubygems_version: 2.0.14
157
156
  signing_key:
158
157
  specification_version: 4
159
158
  summary: Create customizable Minitest output formats
160
- test_files: []
159
+ test_files:
160
+ - test/gallery/bad_test.rb
161
+ - test/gallery/good_test.rb
162
+ - test/integration/fixtures/junit_filename_bug_example_test.rb
163
+ - test/integration/reporters/junit_reporter_test.rb
164
+ - test/test_helper.rb
165
+ - test/unit/minitest/extensible_backtrace_filter_test.rb
166
+ - test/unit/minitest/reporters_test.rb
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.0.0-p353