minitest-json-reporter 0.1.4 → 0.1.5

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
  SHA256:
3
- metadata.gz: 94ec049ea347d4e969d2b6148d0954c1da854278afb03cffa19ae27436821f73
4
- data.tar.gz: 5feec8c4be914f2357e0e92e76c710c5f1595c54295429aacedb5777a301e097
3
+ metadata.gz: 83ca1abb1bdcf181277b04e12369144e57a31da2e3c2a487a46519c14e9b4c45
4
+ data.tar.gz: f5d2a7f0e240f6fe1d8bd8c6a90263b569d7276e00efed75f22658f415e15f3c
5
5
  SHA512:
6
- metadata.gz: e00f01fe7b8bb6ff4ebf68472f102fee74700e68d1e910ada1064807690bf4a420201465c28ba3e5bc404a92148ec2eb24430d30344db005034be55db701760f
7
- data.tar.gz: 1138fda7a9f211487d2e5932cc55aebf4bc3e5d2481fedb9b5870a366f1640a7eac8916b9f5a0a1b036ac995cc6961cb10879df1aa92054c1d0c68b2aa80e4f5
6
+ metadata.gz: 13dd86c13ea0f46b6cfa8cea08bcabe12eb2c471145c6f2b33f3710fecf4e1c92fdf299c1059beb8474b96f8d991593af448eb696c0f03b5f7523c07795bdbf7
7
+ data.tar.gz: b33b614beb37fcc2c5eff0ef4a8d518dedcb7ed990b64b622a7f29d3314caf5b413ba02641460a2fe65e05e0b4a1ac284e40a3c4557e1a9a976f432ffb7a6587
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- minitest-json-reporter (0.1.4)
4
+ minitest-json-reporter (0.1.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -16,14 +16,19 @@ module Minitest
16
16
  end
17
17
 
18
18
  class JsonReporter < AbstractReporter
19
- attr_accessor :io, :results
19
+ attr_accessor :io, :results, :assertions, :failures
20
20
 
21
21
  def initialize(options)
22
22
  @io = options[:io]
23
23
  @results = []
24
+ @assertions = 0
25
+ @failures = 0
24
26
  end
25
27
 
26
28
  def record(result)
29
+ self.assertions += result.assertions
30
+ self.failures += result.failures.size
31
+
27
32
  line = result.source_location[-1]
28
33
  failure = result.failures[0]
29
34
 
@@ -41,7 +46,18 @@ module Minitest
41
46
  end
42
47
 
43
48
  def report
44
- results.each { |result| io.write "\n#{result}" }
49
+ io.write(
50
+ JSON.dump(
51
+ {
52
+ examples: results,
53
+ statistics: {
54
+ assertions: assertions,
55
+ failures: failures
56
+ }
57
+ }
58
+ )
59
+ )
60
+ # results.each { |result| io.write "\n#{result}" }
45
61
  end
46
62
  end
47
63
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-json-reporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wei Zhe Heng
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-30 00:00:00.000000000 Z
11
+ date: 2022-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debug