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.
- checksums.yaml +4 -4
- data/lib/minitest/reporter_api.rb +13 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed7b8bdf9c65ce725076397b3e3f655627c48318
|
4
|
+
data.tar.gz: f27ec826ed0188fb0e5b9cce1b7073b395aa1846
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
#
|
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.
|
48
|
+
def self.default_reporter(options)
|
49
49
|
reporter = CompositeReporter.new
|
50
|
-
[
|
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
|
-
|
65
|
+
reporter
|
65
66
|
end
|
66
67
|
|
67
68
|
end
|
69
|
+
|