minitest-reporter-api 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/minitest/reporter_api.rb +13 -11
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5499b3b81d6a80335c090ec5f2f3ee9329a6d3db
4
- data.tar.gz: fb4cdfbd49dad23032f7727dda2485a62bacf958
3
+ metadata.gz: ed7b8bdf9c65ce725076397b3e3f655627c48318
4
+ data.tar.gz: f27ec826ed0188fb0e5b9cce1b7073b395aa1846
5
5
  SHA512:
6
- metadata.gz: cec365466748fcf977765bc0b1c830567ac90df527b4f78ac0bb79ce779fc9217db7f8bbcdf0b0f2c5d86ccfc2e2fca6e0461faef46ce4c3021b23bf853d54a5
7
- data.tar.gz: 700db727acf7aff3a2e962f05d3664dc6ebeaf63bb4c200cb0cdf7f9975dbce37b189955286e95b31a7454c83028362936478f9cd1b1e560f004a7be39de8d17
6
+ metadata.gz: 838e98c77e024c443908506f655a3f5826af020f75ee9c7565719b33d6ba0a3fd96dd1b180636ff2006828d87f67dfae7d8cb9a46a7e20b7525b822328663328
7
+ data.tar.gz: db9345373a7d54a2f3147290b0dacef366a64417ee1d1c2dac6cad2496dae3bf367cabf03ce7ca2687e49a698cf111e178352e238b319bbb48586114cfcc744d
@@ -1,5 +1,7 @@
1
1
  module Minitest
2
2
 
3
+ DEFAULT_REPORTER = [SummaryReporter, ProgressReporter]
4
+
3
5
  ##
4
6
  # Modify Minitest's run method to check for code configured reporters.
5
7
  # This allows reporters to be configured in test helper scripts. e.g.
@@ -22,13 +24,7 @@ module Minitest
22
24
 
23
25
  options = process_args args
24
26
 
25
- if self.reporter
26
- reporter = setup_reporters(self.reporter, options)
27
- else
28
- reporter = CompositeReporter.new
29
- reporter << SummaryReporter.new(options[:io], options)
30
- reporter << ProgressReporter.new(options[:io], options)
31
- end
27
+ reporter = default_reporter(options)
32
28
 
33
29
  self.reporter = reporter # this makes it available to plugins
34
30
  self.init_plugins options
@@ -43,11 +39,16 @@ module Minitest
43
39
  end
44
40
 
45
41
  ##
46
- # Initialize reporters, if need be, and add to `reporter` property.
42
+ # Create default composite reporter.
43
+ #
44
+ # Unfortunately some reporters take no arguments, some take just `options`
45
+ # and others take `io` and `options`, so the arity is used to determine
46
+ # which arguments to use.
47
47
 
48
- def self.setup_reporters(reporters, options)
48
+ def self.default_reporter(options)
49
49
  reporter = CompositeReporter.new
50
- [reporters].flatten.each do |rpt|
50
+ defaults = [self.reporter || DEFAULT_REPORTER].flatten
51
+ defaults.each do |rpt|
51
52
  reporter << (
52
53
  case rpt
53
54
  when Class
@@ -61,7 +62,8 @@ module Minitest
61
62
  end
62
63
  )
63
64
  end
64
- return reporter
65
+ reporter
65
66
  end
66
67
 
67
68
  end
69
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-reporter-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - trans