jasmine_junitxml_formatter 1.2.0 → 3.0.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 +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +4 -5
- data/Gemfile +6 -3
- data/README.md +7 -0
- data/jasmine_junitxml_formatter.gemspec +6 -8
- data/lib/jasmine/formatters/junit_xml.rb +5 -1
- data/lib/jasmine_junitxml_formatter/version.rb +1 -1
- data/spec/lib/jasmine/formatters/junit_xml_spec.rb +58 -0
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8fa5326e4f945957037b7bf66493acf4b05fa83
|
4
|
+
data.tar.gz: 7d96826cccdacec287b7025f53d55bad2e36b848
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2337f216856fac5ee34c8220645e89ded6cda9eaf809ff7ca53c1b435c4f92855ca8d8fbad3be9093d5149529fb15ca6f09288e16a09d05fe1ee4c1f2b3e5171
|
7
|
+
data.tar.gz: 8f03fa62dcfa9f33d9c0af46ae59af84586edba752cc6bb11c68becdc2678fc33946d5ed53584751ed74c60de554185962bbef4d27c2be48a26cf83389fbc2d1
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -2,7 +2,10 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
if ENV['TRAVIS']
|
6
|
+
gem 'jasmine', :git => 'https://github.com/pivotal/jasmine-gem.git'
|
7
|
+
else
|
8
|
+
gem 'jasmine', :path => '../jasmine-gem'
|
9
|
+
end
|
7
10
|
|
8
|
-
gem 'rack'
|
11
|
+
gem 'rack'
|
data/README.md
CHANGED
@@ -33,6 +33,13 @@ The config file will be processed with ERB if you want to make the destination d
|
|
33
33
|
---
|
34
34
|
junit_xml_path: <%= File.join(Dir.pwd, 'some', 'relative', 'path')
|
35
35
|
|
36
|
+
### Configuring the output filename:
|
37
|
+
|
38
|
+
To configure the filename of the XML file that is generated, the `junit_xml_filename` configuration option can be used, otherwise the default filename is `junit_results.xml`
|
39
|
+
|
40
|
+
---
|
41
|
+
junit_xml_filename: custom_filename.junit.xml
|
42
|
+
|
36
43
|
## Contributing
|
37
44
|
|
38
45
|
1. Fork it
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.name = "jasmine_junitxml_formatter"
|
19
19
|
spec.version = JasmineJunitxmlFormatter::VERSION
|
20
20
|
spec.authors = ["Gregg Van Hove"]
|
21
|
-
spec.email = ["
|
21
|
+
spec.email = ["gvanhove@pivotal.io"]
|
22
22
|
spec.description = %q{Format jasmine results as junit compatible XML so CI servers, like Hudson/Jenkins can parse it}
|
23
23
|
spec.summary = %q{Format jasmine results as junit compatible XML so CI servers, like Hudson/Jenkins can parse it}
|
24
24
|
spec.homepage = "https://github.com/jasmine/jasmine_junitxml_formatter"
|
@@ -29,14 +29,12 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
30
30
|
spec.require_paths = ["lib"]
|
31
31
|
|
32
|
-
spec.
|
32
|
+
spec.required_ruby_version = '>= 2.3'
|
33
|
+
|
34
|
+
spec.add_development_dependency "bundler", ">= 1.15.1"
|
33
35
|
spec.add_development_dependency 'rspec'
|
34
36
|
spec.add_development_dependency "rake"
|
35
37
|
|
36
|
-
spec.add_dependency 'jasmine', '~>
|
37
|
-
|
38
|
-
spec.add_dependency 'nokogiri', '< 1.7.0'
|
39
|
-
else
|
40
|
-
spec.add_dependency 'nokogiri'
|
41
|
-
end
|
38
|
+
spec.add_dependency 'jasmine', '~> 3.0'
|
39
|
+
spec.add_dependency 'nokogiri'
|
42
40
|
end
|
@@ -83,7 +83,7 @@ module Jasmine
|
|
83
83
|
testsuite['errors'] = 0
|
84
84
|
|
85
85
|
FileUtils.mkdir_p(output_dir)
|
86
|
-
File.open(File.join(output_dir,
|
86
|
+
File.open(File.join(output_dir, output_filename), 'w') do |file|
|
87
87
|
file.puts doc.to_xml(indent: 2)
|
88
88
|
end
|
89
89
|
end
|
@@ -95,6 +95,10 @@ module Jasmine
|
|
95
95
|
config['junit_xml_path'] || Dir.pwd
|
96
96
|
end
|
97
97
|
|
98
|
+
def output_filename
|
99
|
+
config['junit_xml_filename'] || 'junit_results.xml'
|
100
|
+
end
|
101
|
+
|
98
102
|
def load_config(filepath=nil)
|
99
103
|
filepath ||= File.join(Dir.pwd, 'spec', 'javascripts', 'support', 'jasmine_junitxml_formatter.yml')
|
100
104
|
@config = YAML::load(ERB.new(File.read(filepath)).result(binding)) if File.exist?(filepath)
|
@@ -169,6 +169,64 @@ YAML
|
|
169
169
|
end
|
170
170
|
end
|
171
171
|
|
172
|
+
describe 'when the output filename has been customized' do
|
173
|
+
before do
|
174
|
+
allow(Dir).to receive(:pwd).and_return('/default_path')
|
175
|
+
end
|
176
|
+
|
177
|
+
it 'writes to the specified location if provided in jasmine_junitxml_formatter.yml' do
|
178
|
+
config_path = File.join('/default_path', 'spec', 'javascripts', 'support', 'jasmine_junitxml_formatter.yml')
|
179
|
+
allow(File).to receive(:exist?).with(config_path).and_return(true)
|
180
|
+
allow(File).to receive(:read).with(config_path).and_return <<-YAML
|
181
|
+
---
|
182
|
+
junit_xml_filename: "custom_filename.junit.xml"
|
183
|
+
YAML
|
184
|
+
allow(File).to receive(:open).and_call_original
|
185
|
+
allow(File).to receive(:open).with('/default_path/custom_filename.junit.xml', 'w').and_yield(file_stub)
|
186
|
+
|
187
|
+
results = [passing_result('fullName' => 'Passing test', 'description' => 'test')]
|
188
|
+
subject = Jasmine::Formatters::JunitXml.new
|
189
|
+
|
190
|
+
subject.format(results)
|
191
|
+
subject.done({})
|
192
|
+
expect(file_stub.content).to_not eq ''
|
193
|
+
end
|
194
|
+
|
195
|
+
it 'writes to default location if junit_xml_filename is not provided in jasmine_junitxml_formatter.yml' do
|
196
|
+
allow(File).to receive(:open).and_call_original
|
197
|
+
allow(File).to receive(:open).with('/default_path/junit_results.xml', 'w').and_yield(file_stub)
|
198
|
+
|
199
|
+
results = [passing_result('fullName' => 'Passing test', 'description' => 'test')]
|
200
|
+
subject = Jasmine::Formatters::JunitXml.new
|
201
|
+
|
202
|
+
subject.format(results)
|
203
|
+
subject.done({})
|
204
|
+
expect(file_stub.content).to_not eq ''
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
describe 'when both the output directory and output filename has been customized' do
|
209
|
+
it 'writes to the customized location using the customized filename if provided in jasmine_junitxml_formatter.yml' do
|
210
|
+
allow(Dir).to receive(:pwd).and_return('/default_path')
|
211
|
+
config_path = File.join('/default_path', 'spec', 'javascripts', 'support', 'jasmine_junitxml_formatter.yml')
|
212
|
+
allow(File).to receive(:exist?).with(config_path).and_return(true)
|
213
|
+
allow(File).to receive(:read).with(config_path).and_return <<-YAML
|
214
|
+
---
|
215
|
+
junit_xml_path: "/custom_path"
|
216
|
+
junit_xml_filename: "custom_filename.junit.xml"
|
217
|
+
YAML
|
218
|
+
allow(File).to receive(:open).and_call_original
|
219
|
+
allow(File).to receive(:open).with('/custom_path/custom_filename.junit.xml', 'w').and_yield(file_stub)
|
220
|
+
|
221
|
+
results = [passing_result('fullName' => 'Passing test', 'description' => 'test')]
|
222
|
+
subject = Jasmine::Formatters::JunitXml.new
|
223
|
+
|
224
|
+
subject.format(results)
|
225
|
+
subject.done({})
|
226
|
+
expect(file_stub.content).to_not eq ''
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
172
230
|
describe 'with a custom config file path' do
|
173
231
|
before do
|
174
232
|
allow(Dir).to receive(:pwd).and_return('/default_path')
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jasmine_junitxml_formatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregg Van Hove
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.15.1
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.15.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '3.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '3.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: nokogiri
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -83,7 +83,7 @@ dependencies:
|
|
83
83
|
description: Format jasmine results as junit compatible XML so CI servers, like Hudson/Jenkins
|
84
84
|
can parse it
|
85
85
|
email:
|
86
|
-
-
|
86
|
+
- gvanhove@pivotal.io
|
87
87
|
executables: []
|
88
88
|
extensions: []
|
89
89
|
extra_rdoc_files: []
|
@@ -120,7 +120,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
120
120
|
requirements:
|
121
121
|
- - ">="
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version: '
|
123
|
+
version: '2.3'
|
124
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
125
|
requirements:
|
126
126
|
- - ">="
|
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
128
|
version: '0'
|
129
129
|
requirements: []
|
130
130
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.
|
131
|
+
rubygems_version: 2.6.11
|
132
132
|
signing_key:
|
133
133
|
specification_version: 4
|
134
134
|
summary: Format jasmine results as junit compatible XML so CI servers, like Hudson/Jenkins
|