minitest-reporter-api 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/.index +1 -1
  3. data/lib/minitest/reporter_api.rb +12 -6
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cacb207f97e6d2e9e9a6e996b7202cb3402c4121
4
- data.tar.gz: d05828e9ad31f888b106b0672e249cf3f9676025
3
+ metadata.gz: 3978618b01439a40d4b35086c4169b0422f6d174
4
+ data.tar.gz: 63d756ac2162409120a3d143bb2e0ea8ecfe84ad
5
5
  SHA512:
6
- metadata.gz: de7cff4a5d0a4cde88650410a71fa58422c04c9a644ca463fc9b01b4f741163cb51c0b577dea379ce71ade4bed60d60e35ed4a0cd33211ea9f344a6ca8102688
7
- data.tar.gz: 32bb8172d4d4e273e19e0fa901c915d66d9fd5208689bf64bb7fd95e6d724cdfdc1634b89c16b2e72289cd33d0c5ddb70ecf9816cba586c50da58fcfcde0a33c
6
+ metadata.gz: 09ddac59876ddc9ec3c32dcebfb5a8d3c4253ddab2832b3c97e33f2ad5d0502af8953ff5204a776905bae108d69dbf0ac587d92f2300cb0f52fc85e1731ac9f2
7
+ data.tar.gz: 2f9439ed73b320b4143b98cd2e7ed70f737315419772974b09be78b9a5467268b1f407e18c9cb4233351e659c5a196313511a5fb5e95881d1dbbadb3fb6d26d3
data/.index CHANGED
@@ -51,5 +51,5 @@ summary: Minitest API for setting reporter in code.
51
51
  description: |-
52
52
  Minitest Report API is a small patch to Minitest that allows reporters to be
53
53
  set in code, i.e. test_helper.rb script, rather then just via the command line.
54
- version: 0.0.4
54
+ version: 0.0.5
55
55
  date: '2013-11-19'
@@ -34,7 +34,7 @@ module Minitest
34
34
 
35
35
  reporter.start
36
36
  __run reporter, options
37
- self.parallel_executor.shutdown rescue nil
37
+ self.parallel_executor.shutdown if VERSION > "5.0.8"
38
38
  reporter.report
39
39
 
40
40
  reporter.passed?
@@ -43,9 +43,9 @@ module Minitest
43
43
  ##
44
44
  # Create default composite reporter.
45
45
  #
46
- # Unfortunately some reporters take no arguments, some take just `options`
47
- # and others take `io` and `options`, so the arity is used to determine
48
- # which arguments to use.
46
+ # Some reporters take no arguments, some take just `options` and others
47
+ # take `io` and `options`, so the length of the method parameters is
48
+ # used to determine which arguments to use.
49
49
 
50
50
  def self.default_reporter(options)
51
51
  reporter = CompositeReporter.new
@@ -54,9 +54,15 @@ module Minitest
54
54
  reporter << (
55
55
  case rpt
56
56
  when Class
57
- case rpt.method(:new).arity
57
+ params = rpt.instance_method(:initialize).parameters
58
+ case params.size #arity
58
59
  when 0 then rpt.new
59
- when 1, -1 then rpt.new(options)
60
+ when 1 then
61
+ if params == [[:rest]] # best guess
62
+ rpt.new(options[:io], options)
63
+ else
64
+ rpt.new(options)
65
+ end
60
66
  else rpt.new(options[:io], options)
61
67
  end
62
68
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-reporter-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - trans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-19 00:00:00.000000000 Z
11
+ date: 2013-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest