minitest-json-reporter 0.1.4 → 0.1.6

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: 631908151f53d96380910576fdd54aa5c48339ce3ca7170720ea18c6c9be54b8
4
+ data.tar.gz: cd5989bebee5beb2456c327a5b035fea047441ac991149113ffa8585f563c9fb
5
5
  SHA512:
6
- metadata.gz: e00f01fe7b8bb6ff4ebf68472f102fee74700e68d1e910ada1064807690bf4a420201465c28ba3e5bc404a92148ec2eb24430d30344db005034be55db701760f
7
- data.tar.gz: 1138fda7a9f211487d2e5932cc55aebf4bc3e5d2481fedb9b5870a366f1640a7eac8916b9f5a0a1b036ac995cc6961cb10879df1aa92054c1d0c68b2aa80e4f5
6
+ metadata.gz: 9f172db0e3e40f9727c08ac9261df9e89306edd07df032b3e6474fff53a023867f2ceea1adaa7be20d3837b33a6b2a57160da49f6ed9ebea67cf1396c5185017
7
+ data.tar.gz: 33871dfc5e50b7185655f37f796c566f8484f2cc288d0aa6baacddfef0304dde72e14d17672b76c14845e8426cc280ba66b6a12207415979fb30a8848f44372e
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.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -16,19 +16,24 @@ 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
 
30
- if failure
31
- # "/Users/marcusheng/projects/rails/budgetyourtime/test/models/user_test.rb:11"
35
+ if failure && !failure.is_a?(Minitest::UnexpectedError)
36
+ # "/Users/marcusheng/projects/rails/sample_project/test/models/user_test.rb:11"
32
37
  line = failure.location.split("/")[-1].split(":")[-1]
33
38
  end
34
39
 
@@ -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.6
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: 2023-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debug
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  - !ruby/object:Gem::Version
66
66
  version: '0'
67
67
  requirements: []
68
- rubygems_version: 3.3.22
68
+ rubygems_version: 3.4.1
69
69
  signing_key:
70
70
  specification_version: 4
71
71
  summary: A minitest JSON reporter plugin