simplecov-cobertura 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce7b99ac8380e1a484798858b4b10aecd158c7287b94db50cff33e498bd89239
4
- data.tar.gz: b014a903090c15eb923fe7056c5d53a4fa8fd447726f26fa4b705bb3e72010db
3
+ metadata.gz: 7c2d0c9eebf10fae25ce491aa5b33fd744cb72c8bd3b9645706e8b6f35495e88
4
+ data.tar.gz: 8890ee7ca2a87b49a4f37ee049bbb6d9375f5ead377bc2e3e32ee793883f56a4
5
5
  SHA512:
6
- metadata.gz: 3902717d69048539f0b1ffc2a4bcab3df384976745ffdafb308d3242232ca588f09aa6c7c954c6719a8899666038248caa208b279608fb4d063ead92019b03c1
7
- data.tar.gz: e2170d9b3ceb19976b091a3519965ddd3ad4b88aa85519c67802edd27a3f18ddfcafa27471caf516d6088a95d2aba0941157b6cb10ff7a2710910cc4ee8256e9
6
+ metadata.gz: ce64fbbd3eb2986a45d90800573739d5f558162a8a66223007926a799e0ba082c4393a7eae1974fe8f40c7b1a22b1f3bebe3adb696805a29a2206c7c5a0b6a21
7
+ data.tar.gz: ed1e556b151833e2db0eeb4a2e8a0539946f80af3a3a85429e708a119065def438032eb660437367f1bd34c91eb1d75d7636ca3958844ca83249ef433080eb6d
@@ -1,7 +1,7 @@
1
1
  module SimpleCov
2
2
  module Formatter
3
3
  class CoberturaFormatter
4
- VERSION = '2.0.0'
4
+ VERSION = '2.1.0'
5
5
  end
6
6
  end
7
7
  end
@@ -12,9 +12,13 @@ module SimpleCov
12
12
  RESULT_FILE_NAME = 'coverage.xml'
13
13
  DTD_URL = 'http://cobertura.sourceforge.net/xml/coverage-04.dtd'
14
14
 
15
+ def initialize(result_file_name: RESULT_FILE_NAME)
16
+ @result_file_name = result_file_name
17
+ end
18
+
15
19
  def format(result)
16
20
  xml_doc = result_to_xml result
17
- result_path = File.join(SimpleCov.coverage_path, RESULT_FILE_NAME)
21
+ result_path = File.join(SimpleCov.coverage_path, @result_file_name)
18
22
 
19
23
  formatter = REXML::Formatters::Pretty.new
20
24
  formatter.compact = true
@@ -35,6 +35,13 @@ class CoberturaFormatterTest < Test::Unit::TestCase
35
35
  assert_equal(xml, IO.read(result_path))
36
36
  end
37
37
 
38
+ def test_format_save_custom_filename
39
+ xml = SimpleCov::Formatter::CoberturaFormatter.new(result_file_name: 'cobertura.xml').format(@result)
40
+ result_path = File.join(SimpleCov.coverage_path, 'cobertura.xml')
41
+ assert_not_empty(xml)
42
+ assert_equal(xml, IO.read(result_path))
43
+ end
44
+
38
45
  def test_terminal_output
39
46
  output, _ = capture_output { @formatter.format(@result) }
40
47
  result_path = File.join(SimpleCov.coverage_path, SimpleCov::Formatter::CoberturaFormatter::RESULT_FILE_NAME)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplecov-cobertura
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Bowes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-24 00:00:00.000000000 Z
11
+ date: 2021-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-unit
@@ -89,7 +89,6 @@ extra_rdoc_files: []
89
89
  files:
90
90
  - ".github/workflows/build.yml"
91
91
  - ".gitignore"
92
- - ".ruby-version"
93
92
  - Gemfile
94
93
  - LICENSE
95
94
  - README.md
@@ -118,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
117
  - !ruby/object:Gem::Version
119
118
  version: '0'
120
119
  requirements: []
121
- rubygems_version: 3.1.6
120
+ rubygems_version: 3.2.22
122
121
  signing_key:
123
122
  specification_version: 4
124
123
  summary: SimpleCov Cobertura Formatter
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 3.0.2