minitest-junit 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +3 -1
- data/lib/minitest/junit/version.rb +1 -1
- data/lib/minitest/junit.rb +6 -6
- data/test/reporter_test.rb +13 -1
- data/test/tmp/.keep +0 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28a6272dfe9b52525afbcfc9a98fa0610bca6531d685f2e1c2bb5c838ac55480
|
4
|
+
data.tar.gz: 561f4eb58db6d84edd0c6da41aa463f736a14984870aa7b4f00e6bdefae09133
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57482ae234635c9a5f9f697d964361b614e8d47da5a5a60e9e49ae4a7f1aab7b7771af7f902f0cbb49272c2404bd9e612913d7926a7c8c437a116d9b01dc2f58
|
7
|
+
data.tar.gz: 33b11351e74c51bd4ba23549165b4138837574396d08a2da97c0e33e51ae0efcf9a84c5367d1d2f328005deb66763372462ef209968b96d0ae20111a71715dfc
|
data/.github/workflows/main.yml
CHANGED
data/lib/minitest/junit.rb
CHANGED
@@ -28,11 +28,12 @@ module Minitest
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def report
|
31
|
-
doc = Ox::Document.new(:
|
31
|
+
doc = Ox::Document.new(version: '1.0', encoding: 'UTF-8')
|
32
32
|
instruct = Ox::Instruct.new(:xml)
|
33
33
|
instruct[:version] = '1.0'
|
34
34
|
instruct[:encoding] = 'UTF-8'
|
35
35
|
doc << instruct
|
36
|
+
|
36
37
|
testsuite = Ox::Element.new('testsuite')
|
37
38
|
testsuite['name'] = @options[:name] || 'minitest'
|
38
39
|
testsuite['timestamp'] = @options[:timestamp]
|
@@ -46,7 +47,10 @@ module Minitest
|
|
46
47
|
testsuite << format(result)
|
47
48
|
end
|
48
49
|
|
49
|
-
|
50
|
+
testsuites = Ox::Element.new('testsuites')
|
51
|
+
testsuites << testsuite
|
52
|
+
|
53
|
+
doc << testsuites
|
50
54
|
@io << Ox.dump(doc)
|
51
55
|
end
|
52
56
|
|
@@ -89,10 +93,6 @@ module Minitest
|
|
89
93
|
@working_directory ||= Dir.getwd
|
90
94
|
end
|
91
95
|
|
92
|
-
def failure_message(result)
|
93
|
-
"#{result.klass}##{result.name}: #{result.failure}"
|
94
|
-
end
|
95
|
-
|
96
96
|
def relative_to_cwd(path)
|
97
97
|
path.sub(working_directory, '.')
|
98
98
|
end
|
data/test/reporter_test.rb
CHANGED
@@ -14,11 +14,23 @@ class ReporterTest < Minitest::Test
|
|
14
14
|
reporter.report
|
15
15
|
|
16
16
|
assert_match(
|
17
|
-
%r{<?xml version="1.0" encoding="UTF-8"\?>\n<testsuite name="minitest" timestamp="[^"]+" hostname="[^"]+" tests="0" skipped="0" failures="0" errors="0" time="0.000000"
|
17
|
+
%r{<?xml version="1.0" encoding="UTF-8"\?>\n<testsuites>\n <testsuite name="minitest" timestamp="[^"]+" hostname="[^"]+" tests="0" skipped="0" failures="0" errors="0" time="0.000000"\/>\n<\/testsuites>\n},
|
18
18
|
reporter.output
|
19
19
|
)
|
20
20
|
end
|
21
21
|
|
22
|
+
# NOTE: This test will generate a temp file: "test/tmp/report.xml"
|
23
|
+
def test_encoding
|
24
|
+
# Enforce File.external_encoding to UTF-8 to ensure that ASCII character will be correctly converted to UTF-8
|
25
|
+
file = File.new('test/tmp/report.xml', 'w:UTF-8')
|
26
|
+
reporter = Minitest::Junit::Reporter.new file, { hostname: '‹foo›' }
|
27
|
+
reporter.start
|
28
|
+
reporter.report
|
29
|
+
file.close
|
30
|
+
|
31
|
+
assert_match(/hostname="‹foo›"/, File.new('test/tmp/report.xml', 'r:UTF-8').read)
|
32
|
+
end
|
33
|
+
|
22
34
|
def test_formats_each_successful_result_with_a_formatter
|
23
35
|
reporter = create_reporter
|
24
36
|
|
data/test/tmp/.keep
ADDED
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-junit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Allan Espinosa
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- test/junit_plugin_test.rb
|
136
136
|
- test/reporter_test.rb
|
137
137
|
- test/testcase_formatter_test.rb
|
138
|
+
- test/tmp/.keep
|
138
139
|
homepage: http://github.com/aespinosa/minitest-junit
|
139
140
|
licenses:
|
140
141
|
- MIT
|
@@ -163,3 +164,4 @@ test_files:
|
|
163
164
|
- test/junit_plugin_test.rb
|
164
165
|
- test/reporter_test.rb
|
165
166
|
- test/testcase_formatter_test.rb
|
167
|
+
- test/tmp/.keep
|