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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 518beb2f7cb77d8e953d77f9b4342c5ec1d20603b8807782f71305b58a0f985d
4
- data.tar.gz: d3dec1da3aa864c7e92a80628353e24c75a465df90d7e60fddb134a1dc725d89
3
+ metadata.gz: 28a6272dfe9b52525afbcfc9a98fa0610bca6531d685f2e1c2bb5c838ac55480
4
+ data.tar.gz: 561f4eb58db6d84edd0c6da41aa463f736a14984870aa7b4f00e6bdefae09133
5
5
  SHA512:
6
- metadata.gz: 1c2bc15ede221fc4128d62be93abd9dc6eb6137dd409faf763507c938b9d4bfdb4dd79af78d7de3f195ce1758dc72d5b6d1096c9b28893062c54db90c1a179bc
7
- data.tar.gz: 32a0b2014027182f2c357b76defd7402fbc4996d994c5e8f3189844c66d634c16cfd26b9e0c524af3328bf347c5bbf608a480d85f927a021de81ce037543b760
6
+ metadata.gz: 57482ae234635c9a5f9f697d964361b614e8d47da5a5a60e9e49ae4a7f1aab7b7771af7f902f0cbb49272c2404bd9e612913d7926a7c8c437a116d9b01dc2f58
7
+ data.tar.gz: 33b11351e74c51bd4ba23549165b4138837574396d08a2da97c0e33e51ae0efcf9a84c5367d1d2f328005deb66763372462ef209968b96d0ae20111a71715dfc
@@ -1,7 +1,9 @@
1
1
  name: Main
2
2
  on:
3
3
  push:
4
- workflow_dispatch:
4
+ branches: [release]
5
+ pull_request:
6
+ types: [opened, synchronize]
5
7
 
6
8
  jobs:
7
9
  tests:
@@ -1,6 +1,6 @@
1
1
  module Minitest
2
2
  # :nodoc:
3
3
  module Junit
4
- VERSION = '2.0.0'
4
+ VERSION = '2.0.1'
5
5
  end
6
6
  end
@@ -28,11 +28,12 @@ module Minitest
28
28
  end
29
29
 
30
30
  def report
31
- doc = Ox::Document.new(:version => '1.0')
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
- doc << testsuite
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
@@ -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.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