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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/minitest/json_reporter_plugin.rb +20 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 631908151f53d96380910576fdd54aa5c48339ce3ca7170720ea18c6c9be54b8
|
4
|
+
data.tar.gz: cd5989bebee5beb2456c327a5b035fea047441ac991149113ffa8585f563c9fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f172db0e3e40f9727c08ac9261df9e89306edd07df032b3e6474fff53a023867f2ceea1adaa7be20d3837b33a6b2a57160da49f6ed9ebea67cf1396c5185017
|
7
|
+
data.tar.gz: 33871dfc5e50b7185655f37f796c566f8484f2cc288d0aa6baacddfef0304dde72e14d17672b76c14845e8426cc280ba66b6a12207415979fb30a8848f44372e
|
data/Gemfile.lock
CHANGED
@@ -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/
|
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
|
-
|
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
|
+
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:
|
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.
|
68
|
+
rubygems_version: 3.4.1
|
69
69
|
signing_key:
|
70
70
|
specification_version: 4
|
71
71
|
summary: A minitest JSON reporter plugin
|