minitest-reporters 1.0.10 → 1.0.11

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: a102548096d04d4c480bcfc80cf04caee4412476
4
- data.tar.gz: d44d2574c7b515078eedd51acef5956608e81c90
3
+ metadata.gz: 92e61c0020d2e663b9cb9fb7cf1f6a24e39538dd
4
+ data.tar.gz: 85ab14f1d378f773157479bffb1b96ee2b0346b2
5
5
  SHA512:
6
- metadata.gz: 3e6ea9348e2b0b4f0c67684b0c4b8ba681b00c14262000d18b655fb5861bf78a96a7d9be9a70b24328498e11e573a81e097c2aa3d23226caeec2eb322a8789fb
7
- data.tar.gz: 1417edd27fcc0d1e6b8f11113b896abeb9ea0903d2ec9a4f35901d1f0fe35d7cda7ae7cda35d52931f5b4f7d50e7a66b14988f84b6573f36e5d628c84b0e86cf
6
+ metadata.gz: 9e9f1b3cd940f6e84e980118df9752a8a3845f12d2db1616aa6091d7b71af2b7498083ebe28a03bfde789450b076a311f05c47fa9fd49de9c02172f7711bbf64
7
+ data.tar.gz: c0e9060b8d3d13755d054e5ba5bb24e0fd4d198e561988057c998bf4e50e16543d5e9620696965050c1ce485a6390f093feaaf05d8ce2bea952e4323967e6a3f
data/README.md CHANGED
@@ -84,7 +84,7 @@ do this in `test_helper.rb`:
84
84
  Minitest.backtrace_filter
85
85
  )
86
86
 
87
- The third parameter to `.new`, in this case `Minitest.backtrace_filter`, should be a
87
+ The third parameter to `.use!`, in this case `Minitest.backtrace_filter`, should be a
88
88
  filter object. In the above example, you're telling minitest-reporters to use the filter
89
89
  that Rails has already set.
90
90
 
@@ -5,7 +5,7 @@ module Minitest
5
5
  reporter.reporters = Minitest::Reporters.reporters + guard_reporter
6
6
  reporter.reporters.each do |reporter|
7
7
  reporter.io = options[:io]
8
- reporter.add_defaults(options.merge(:total_count => total_count(options)))
8
+ reporter.add_defaults(options.merge(:total_count => total_count(options))) if reporter.respond_to? :add_defaults
9
9
  end
10
10
  end
11
11
  end
@@ -40,12 +40,13 @@ module Minitest
40
40
 
41
41
  def record(test)
42
42
  super
43
- if (test.skipped? && @detailed_skip) || test.failure
43
+ return if test.skipped? && !@detailed_skip
44
+ if test.failure
44
45
  print "\e[0m\e[1000D\e[K"
45
46
  print_colored_status(test)
46
47
  print_test_with_time(test)
47
48
  puts
48
- print_info(test.failure, test.error?) if test.failure
49
+ print_info(test.failure, test.error?)
49
50
  puts
50
51
  end
51
52
 
@@ -1,5 +1,5 @@
1
1
  module Minitest
2
2
  module Reporters
3
- VERSION = '1.0.10'
3
+ VERSION = '1.0.11'
4
4
  end
5
5
  end
@@ -0,0 +1,8 @@
1
+ require 'bundler/setup'
2
+ require 'minitest/autorun'
3
+ require 'minitest/reporters'
4
+
5
+ Minitest::Reporters.use! Minitest::Reporters::ProgressReporter.new(detailed_skip: false)
6
+
7
+ require_relative 'sample_test'
8
+
@@ -0,0 +1,8 @@
1
+ require 'bundler/setup'
2
+ require 'minitest/autorun'
3
+ require 'minitest/reporters'
4
+
5
+ Minitest::Reporters.use! Minitest::Reporters::ProgressReporter.new
6
+
7
+ require_relative 'sample_test'
8
+
@@ -0,0 +1,15 @@
1
+ Class.new(Minitest::Test) do
2
+ def test_success
3
+ assert true
4
+ end
5
+ def test_failure
6
+ assert false
7
+ end
8
+ def test_skip
9
+ skip('Skipping rope')
10
+ end
11
+ def test_error
12
+ raise 'An unexpected error'
13
+ end
14
+ end
15
+
@@ -3,7 +3,7 @@ require_relative "../../test_helper"
3
3
  module MinitestReportersTest
4
4
  class JUnitReporterTest < TestCase
5
5
  def test_replaces_special_characters_for_filenames_and_doesnt_crash
6
- fixtures_directory = File.expand_path('../../fixtures', __FILE__)
6
+ fixtures_directory = File.expand_path('../../../fixtures', __FILE__)
7
7
  test_filename = File.join(fixtures_directory, 'junit_filename_bug_example_test.rb')
8
8
  output = `ruby #{test_filename} 2>&1`
9
9
  refute_match 'No such file or directory', output
@@ -0,0 +1,22 @@
1
+ require_relative "../../test_helper"
2
+
3
+ module MinitestReportersTest
4
+ class ProgressReporterTest < TestCase
5
+ def test_all_failures_are_displayed
6
+ fixtures_directory = File.expand_path('../../../fixtures', __FILE__)
7
+ test_filename = File.join(fixtures_directory, 'progress_test.rb')
8
+ output = `ruby #{test_filename} 2>&1`
9
+ assert_match 'ERROR["test_error"', output, 'Errors should be displayed'
10
+ assert_match 'FAIL["test_failure"', output, 'Failures should be displayed'
11
+ assert_match 'SKIP["test_skip', output, 'Skipped tests should be displayed'
12
+ end
13
+ def test_skipped_tests_are_not_displayed
14
+ fixtures_directory = File.expand_path('../../../fixtures', __FILE__)
15
+ test_filename = File.join(fixtures_directory, 'progress_detailed_skip_test.rb')
16
+ output = `ruby #{test_filename} 2>&1`
17
+ assert_match 'ERROR["test_error"', output, 'Errors should be displayed'
18
+ assert_match 'FAIL["test_failure"', output, 'Failures should be displayed'
19
+ refute_match 'SKIP["test_skip', output, 'Skipped tests should not be displayed'
20
+ end
21
+ end
22
+ end
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.10
4
+ version: 1.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-03 00:00:00.000000000 Z
11
+ date: 2015-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -127,10 +127,14 @@ files:
127
127
  - lib/minitest/reporters/spec_reporter.rb
128
128
  - lib/minitest/reporters/version.rb
129
129
  - minitest-reporters.gemspec
130
+ - test/fixtures/junit_filename_bug_example_test.rb
131
+ - test/fixtures/progress_detailed_skip_test.rb
132
+ - test/fixtures/progress_test.rb
133
+ - test/fixtures/sample_test.rb
130
134
  - test/gallery/bad_test.rb
131
135
  - test/gallery/good_test.rb
132
- - test/integration/fixtures/junit_filename_bug_example_test.rb
133
136
  - test/integration/reporters/junit_reporter_test.rb
137
+ - test/integration/reporters/progress_reporter_test.rb
134
138
  - test/test_helper.rb
135
139
  - test/unit/minitest/extensible_backtrace_filter_test.rb
136
140
  - test/unit/minitest/reporters_test.rb
@@ -158,10 +162,14 @@ signing_key:
158
162
  specification_version: 4
159
163
  summary: Create customizable Minitest output formats
160
164
  test_files:
165
+ - test/fixtures/junit_filename_bug_example_test.rb
166
+ - test/fixtures/progress_detailed_skip_test.rb
167
+ - test/fixtures/progress_test.rb
168
+ - test/fixtures/sample_test.rb
161
169
  - test/gallery/bad_test.rb
162
170
  - test/gallery/good_test.rb
163
- - test/integration/fixtures/junit_filename_bug_example_test.rb
164
171
  - test/integration/reporters/junit_reporter_test.rb
172
+ - test/integration/reporters/progress_reporter_test.rb
165
173
  - test/test_helper.rb
166
174
  - test/unit/minitest/extensible_backtrace_filter_test.rb
167
175
  - test/unit/minitest/reporters_test.rb