rspec_junit 2.0.1 → 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/.coveralls.yml +1 -0
- data/.travis.yml +2 -3
- data/README.md +17 -12
- data/Rakefile +3 -1
- data/features/basic.feature +2 -2
- data/features/individual_suites.feature +2 -2
- data/features/individual_tests.feature +5 -5
- data/features/suite_level_details.feature +6 -6
- data/features/support/env.rb +7 -1
- data/lib/{yarjuf/j_unit.rb → rspec_junit/junit.rb} +0 -0
- data/lib/rspec_junit/version.rb +3 -0
- data/lib/{yarjuf.rb → rspec_junit.rb} +3 -2
- data/rspec_junit.gemspec +4 -7
- data/spec/formatter_conformity_spec.rb +7 -6
- data/spec/spec_helper.rb +3 -1
- metadata +10 -9
- data/lib/yarjuf/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e8c08054a0d713c9923eb1efcbd44835e99d1bd
|
4
|
+
data.tar.gz: 4549415dd031f78f3ea15835ec586f160bbcd153
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f571e6699163d5468bd9e4344d9bb4e329353f3f0036f1592e7329cdd36c04be546f83e154a299fa4652e479a916f2718afb43e19302cd19afab70f876ba5ed3
|
7
|
+
data.tar.gz: b8845a4aeadc906ac4e1f6a6680a0776b351697853063a83730ff1c8e71cff704c6c07ea7f7445ef36b6adc3fa6921a4433576101c326481736fac0b21a3a090
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
# rspec_junit
|
1
|
+
# rspec_junit
|
2
|
+
[](https://rubygems.org/gems/rspec_junit)
|
3
|
+
[](https://travis-ci.org/bootstraponline/rspec_junit)[](https://gemnasium.com/bootstraponline/rspec_junit)
|
4
|
+
[](https://coveralls.io/r/bootstraponline/rspec_junit)
|
2
5
|
|
3
6
|
A fork of [yarjuf](https://github.com/natritmeyer/yarjuf) containing additional features and bug fixes.
|
4
7
|
Another popular junit formatter is [rspec_junit_formatter](https://github.com/sj26/rspec_junit_formatter).
|
@@ -8,10 +11,12 @@ Another popular junit formatter is [rspec_junit_formatter](https://github.com/sj
|
|
8
11
|
Changes from upstream:
|
9
12
|
|
10
13
|
- [Record location information](https://github.com/natritmeyer/yarjuf/pull/18) for per file performance measurement
|
11
|
-
|
14
|
+
- Coveralls setup on Travis CI (100% coverage)
|
15
|
+
- Renamed to rspec_junit instead of yarjuf
|
16
|
+
|
12
17
|
Usage:
|
13
18
|
|
14
|
-
- `require '
|
19
|
+
- `require 'rspec_junit'`
|
15
20
|
|
16
21
|
--
|
17
22
|
|
@@ -27,22 +32,22 @@ distributable as a gem. Thus: [yet-another-rspec-junit-formatter](https://github
|
|
27
32
|
|
28
33
|
Using rubygems:
|
29
34
|
|
30
|
-
`gem install
|
35
|
+
`gem install rspec_junit`
|
31
36
|
|
32
37
|
Using bundler:
|
33
38
|
|
34
39
|
Add the following line to your `Gemfile`:
|
35
40
|
|
36
|
-
`gem '
|
41
|
+
`gem 'rspec_junit'`
|
37
42
|
|
38
43
|
## Usage
|
39
44
|
|
40
45
|
There are a few ways to use custom formatters in RSpec; what follows is
|
41
46
|
the 'best' way...
|
42
47
|
|
43
|
-
### Loading
|
48
|
+
### Loading rspec_junit
|
44
49
|
|
45
|
-
Before you can use
|
50
|
+
Before you can use rspec_junit, RSpec needs to know about it. The best way to
|
46
51
|
do that is to use the functionality that RSpec provides to load
|
47
52
|
libraries.
|
48
53
|
|
@@ -62,16 +67,16 @@ required when RSpec starts.
|
|
62
67
|
Add the following to your `spec/spec_helper.rb`:
|
63
68
|
|
64
69
|
```ruby
|
65
|
-
require '
|
70
|
+
require 'rspec_junit'
|
66
71
|
```
|
67
72
|
|
68
|
-
That will make sure that
|
73
|
+
That will make sure that rspec_junit is loaded when RSpec starts and can be
|
69
74
|
used as a formatter.
|
70
75
|
|
71
|
-
### Generating JUnit output using
|
76
|
+
### Generating JUnit output using rspec_junit
|
72
77
|
|
73
78
|
RSpec tests can be executed in a number of ways. Here's how to get JUnit
|
74
|
-
output for each of those different ways - assuming you've loaded
|
79
|
+
output for each of those different ways - assuming you've loaded rspec_junit
|
75
80
|
as specified above).
|
76
81
|
|
77
82
|
#### Running rspec tests from the command line
|
@@ -100,7 +105,7 @@ That will write out JUnit formatted results to a file called
|
|
100
105
|
|
101
106
|
#### Jenkins integration
|
102
107
|
|
103
|
-
To use
|
108
|
+
To use rspec_junit with Jenkins(/Hudson), simply tick the 'Publish JUnit test
|
104
109
|
result report' option in the Jenkins task configuration page and in the
|
105
110
|
'Test report XMLs' field specify the file name that you expect the JUnit
|
106
111
|
formatted results to be written to, ie: the file path and name specified
|
data/Rakefile
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
2
|
require 'cucumber/rake/task'
|
3
3
|
require 'rspec/core/rake_task'
|
4
|
+
require 'coveralls/rake/task'
|
5
|
+
Coveralls::RakeTask.new
|
4
6
|
|
5
7
|
namespace :cuke do
|
6
8
|
Cucumber::Rake::Task.new(:all) do |t|
|
@@ -19,5 +21,5 @@ namespace :spec do
|
|
19
21
|
end
|
20
22
|
end
|
21
23
|
|
22
|
-
task :default => ['spec:all', 'cuke:all']
|
24
|
+
task :default => ['spec:all', 'cuke:all', 'coveralls:push']
|
23
25
|
|
data/features/basic.feature
CHANGED
@@ -14,11 +14,11 @@ Feature: Basic use of Yarjuf
|
|
14
14
|
"""
|
15
15
|
|
16
16
|
Scenario: Requiring Yarjuf
|
17
|
-
When I run `rspec spec/basic_spec.rb -r ../../lib/
|
17
|
+
When I run `rspec spec/basic_spec.rb -r ../../lib/rspec_junit -f JUnit`
|
18
18
|
Then the exit status should be 0
|
19
19
|
|
20
20
|
Scenario: Writing output to a file
|
21
|
-
When I run `rspec spec/basic_spec.rb -r ../../lib/
|
21
|
+
When I run `rspec spec/basic_spec.rb -r ../../lib/rspec_junit -f JUnit -o results.xml`
|
22
22
|
Then the exit status should be 0
|
23
23
|
And a file named "results.xml" should exist
|
24
24
|
|
@@ -20,7 +20,7 @@ Feature: Individual suites
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
"""
|
23
|
-
When I run `rspec spec/suite_one_spec.rb spec/suite_two_spec.rb -r ../../lib/
|
23
|
+
When I run `rspec spec/suite_one_spec.rb spec/suite_two_spec.rb -r ../../lib/rspec_junit -f JUnit -o results.xml`
|
24
24
|
Then the junit output file contains two testsuite elements named 'suite one' and 'suite two'
|
25
25
|
And the junit output file has one test against each suite
|
26
26
|
|
@@ -76,7 +76,7 @@ Feature: Individual suites
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
"""
|
79
|
-
When I run `rspec spec/suite_one_spec.rb spec/suite_two_spec.rb -r ../../lib/
|
79
|
+
When I run `rspec spec/suite_one_spec.rb spec/suite_two_spec.rb -r ../../lib/rspec_junit -f JUnit -o results.xml`
|
80
80
|
Then the junit output file contains two testsuite elements named 'suite one' and 'suite two'
|
81
81
|
And the junit output file has the correct test counts against each suite
|
82
82
|
|
@@ -12,7 +12,7 @@ Feature: Individual Tests
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
"""
|
15
|
-
When I run `rspec spec/simple_test_name_spec.rb -r ../../lib/
|
15
|
+
When I run `rspec spec/simple_test_name_spec.rb -r ../../lib/rspec_junit -f JUnit -o results.xml`
|
16
16
|
Then the junit output file contains a test result with a simple name
|
17
17
|
|
18
18
|
Scenario: Nested tests
|
@@ -32,7 +32,7 @@ Feature: Individual Tests
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
"""
|
35
|
-
When I run `rspec spec/nested_spec.rb -r ../../lib/
|
35
|
+
When I run `rspec spec/nested_spec.rb -r ../../lib/rspec_junit -f JUnit -o results.xml`
|
36
36
|
Then the junit output file has a nicely rendered nested test name
|
37
37
|
|
38
38
|
Scenario: Test duration
|
@@ -44,7 +44,7 @@ Feature: Individual Tests
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
"""
|
47
|
-
When I run `rspec spec/test_duration_spec.rb -r ../../lib/
|
47
|
+
When I run `rspec spec/test_duration_spec.rb -r ../../lib/rspec_junit -f JUnit -o results.xml`
|
48
48
|
Then the junit output file contains a test with a duration
|
49
49
|
|
50
50
|
Scenario: Pending test
|
@@ -57,7 +57,7 @@ Feature: Individual Tests
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
"""
|
60
|
-
When I run `rspec spec/pending_test_spec.rb -r ../../lib/
|
60
|
+
When I run `rspec spec/pending_test_spec.rb -r ../../lib/rspec_junit -f JUnit -o results.xml`
|
61
61
|
Then the junit output file contains a pending test
|
62
62
|
|
63
63
|
Scenario: Failing test
|
@@ -69,6 +69,6 @@ Feature: Individual Tests
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
"""
|
72
|
-
When I run `rspec spec/failing_test_spec.rb -r ../../lib/
|
72
|
+
When I run `rspec spec/failing_test_spec.rb -r ../../lib/rspec_junit -f JUnit -o results.xml`
|
73
73
|
Then the junit output file contains a failing test
|
74
74
|
|
@@ -12,7 +12,7 @@ Feature: Suite Summary
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
"""
|
15
|
-
When I run `rspec spec/suite_element_spec.rb -r ../../lib/
|
15
|
+
When I run `rspec spec/suite_element_spec.rb -r ../../lib/rspec_junit -f JUnit -o results.xml`
|
16
16
|
Then the junit output contains the testsuite element
|
17
17
|
|
18
18
|
Scenario: One passing test
|
@@ -24,7 +24,7 @@ Feature: Suite Summary
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
"""
|
27
|
-
When I run `rspec spec/one_passing_test_spec.rb -r ../../lib/
|
27
|
+
When I run `rspec spec/one_passing_test_spec.rb -r ../../lib/rspec_junit -f JUnit -o results.xml`
|
28
28
|
Then the junit output reports one passing test
|
29
29
|
|
30
30
|
Scenario: One failing test
|
@@ -36,7 +36,7 @@ Feature: Suite Summary
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
"""
|
39
|
-
When I run `rspec spec/one_failing_test_spec.rb -r ../../lib/
|
39
|
+
When I run `rspec spec/one_failing_test_spec.rb -r ../../lib/rspec_junit -f JUnit -o results.xml`
|
40
40
|
Then the junit output reports one failing test
|
41
41
|
|
42
42
|
Scenario: One pending test
|
@@ -49,7 +49,7 @@ Feature: Suite Summary
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
"""
|
52
|
-
When I run `rspec spec/one_pending_test_spec.rb -r ../../lib/
|
52
|
+
When I run `rspec spec/one_pending_test_spec.rb -r ../../lib/rspec_junit -f JUnit -o results.xml`
|
53
53
|
Then the junit output reports one pending test
|
54
54
|
|
55
55
|
Scenario: Test suite duration
|
@@ -61,7 +61,7 @@ Feature: Suite Summary
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
"""
|
64
|
-
When I run `rspec spec/suite_duration_spec.rb -r ../../lib/
|
64
|
+
When I run `rspec spec/suite_duration_spec.rb -r ../../lib/rspec_junit -f JUnit -o results.xml`
|
65
65
|
Then the junit output testsuite element contains a duration
|
66
66
|
|
67
67
|
Scenario: Test suite time stamp
|
@@ -73,6 +73,6 @@ Feature: Suite Summary
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
"""
|
76
|
-
When I run `rspec spec/suite_timestamp_spec.rb -r ../../lib/
|
76
|
+
When I run `rspec spec/suite_timestamp_spec.rb -r ../../lib/rspec_junit -f JUnit -o results.xml`
|
77
77
|
Then the junit output testsuite element contains a timestamp
|
78
78
|
|
data/features/support/env.rb
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
require 'simplecov'
|
2
|
-
|
2
|
+
require 'coveralls'
|
3
|
+
|
4
|
+
# Omit coveralls formatter since we're merging suite results via a Rake task
|
5
|
+
# https://coveralls.zendesk.com/hc/en-us/articles/201769485-Ruby-Rails
|
6
|
+
SimpleCov.formatters = [SimpleCov::Formatter::HTMLFormatter]
|
7
|
+
|
8
|
+
SimpleCov.start { add_filter 'spec/' }
|
3
9
|
|
4
10
|
require 'aruba/cucumber'
|
5
11
|
require 'nokogiri'
|
File without changes
|
@@ -1,9 +1,10 @@
|
|
1
1
|
# external dependencies
|
2
|
+
require 'rubygems'
|
2
3
|
require 'time'
|
3
4
|
require 'builder'
|
4
5
|
require 'rspec/core'
|
5
6
|
require 'rspec/core/formatters'
|
6
7
|
|
7
8
|
# internal dependencies
|
8
|
-
require '
|
9
|
-
require '
|
9
|
+
require 'rspec_junit/junit'
|
10
|
+
require 'rspec_junit/version'
|
data/rspec_junit.gemspec
CHANGED
@@ -1,15 +1,12 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'yarjuf/version'
|
1
|
+
require_relative 'lib/rspec_junit/version'
|
5
2
|
|
6
3
|
Gem::Specification.new do |gem|
|
7
4
|
gem.name = 'rspec_junit'
|
8
|
-
gem.version =
|
5
|
+
gem.version = RspecJunit::VERSION
|
9
6
|
gem.platform = Gem::Platform::RUBY
|
10
7
|
gem.authors = ['Nat Ritmeyer', 'Ben Snape']
|
11
8
|
gem.email = ['nat@natontesting.com']
|
12
|
-
gem.homepage = 'http://github.com/
|
9
|
+
gem.homepage = 'http://github.com/bootstraponline/rspec_junit'
|
13
10
|
gem.summary = 'Yet Another RSpec JUnit Formatter (for Hudson/Jenkins)'
|
14
11
|
gem.description = 'Yet Another RSpec JUnit Formatter (for Hudson/Jenkins)'
|
15
12
|
|
@@ -25,7 +22,7 @@ Gem::Specification.new do |gem|
|
|
25
22
|
gem.add_development_dependency('rake', '~> 10.3.2')
|
26
23
|
gem.add_development_dependency('cucumber', '~> 1.3.16')
|
27
24
|
gem.add_development_dependency('aruba', '~> 0.6.0')
|
28
|
-
gem.add_development_dependency('
|
25
|
+
gem.add_development_dependency('coveralls', '~> 0.8.1')
|
29
26
|
gem.add_development_dependency('reek', ['= 1.3.7']) # for Ruby 1.8.7
|
30
27
|
gem.add_development_dependency('rainbow', '~> 1.99.2') # for Ruby 1.8.7
|
31
28
|
end
|
@@ -1,20 +1,21 @@
|
|
1
1
|
describe JUnit do
|
2
|
-
context
|
3
|
-
subject { JUnit.new "some output" }
|
2
|
+
context 'interface conformity' do
|
4
3
|
|
5
|
-
|
4
|
+
subject { JUnit.new 'some output' }
|
5
|
+
|
6
|
+
it 'should respond to example passed' do
|
6
7
|
should respond_to :example_passed
|
7
8
|
end
|
8
9
|
|
9
|
-
it
|
10
|
+
it 'should respond to example failed' do
|
10
11
|
should respond_to :example_failed
|
11
12
|
end
|
12
13
|
|
13
|
-
it
|
14
|
+
it 'should respond to example pending' do
|
14
15
|
should respond_to :example_pending
|
15
16
|
end
|
16
17
|
|
17
|
-
it
|
18
|
+
it 'should respond to dump summary' do
|
18
19
|
should respond_to :dump_summary
|
19
20
|
end
|
20
21
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec_junit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nat Ritmeyer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-06-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -96,19 +96,19 @@ dependencies:
|
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: 0.6.0
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
|
-
name:
|
99
|
+
name: coveralls
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
102
|
- - "~>"
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: 0.8.
|
104
|
+
version: 0.8.1
|
105
105
|
type: :development
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
109
|
- - "~>"
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: 0.8.
|
111
|
+
version: 0.8.1
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
113
|
name: reek
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -144,6 +144,7 @@ executables: []
|
|
144
144
|
extensions: []
|
145
145
|
extra_rdoc_files: []
|
146
146
|
files:
|
147
|
+
- ".coveralls.yml"
|
147
148
|
- ".gitignore"
|
148
149
|
- ".rspec"
|
149
150
|
- ".travis.yml"
|
@@ -161,13 +162,13 @@ files:
|
|
161
162
|
- features/step_definitions/suite_level_details_steps.rb
|
162
163
|
- features/suite_level_details.feature
|
163
164
|
- features/support/env.rb
|
164
|
-
- lib/
|
165
|
-
- lib/
|
166
|
-
- lib/
|
165
|
+
- lib/rspec_junit.rb
|
166
|
+
- lib/rspec_junit/junit.rb
|
167
|
+
- lib/rspec_junit/version.rb
|
167
168
|
- rspec_junit.gemspec
|
168
169
|
- spec/formatter_conformity_spec.rb
|
169
170
|
- spec/spec_helper.rb
|
170
|
-
homepage: http://github.com/
|
171
|
+
homepage: http://github.com/bootstraponline/rspec_junit
|
171
172
|
licenses: []
|
172
173
|
metadata: {}
|
173
174
|
post_install_message:
|
data/lib/yarjuf/version.rb
DELETED