rspec_junit_formatter 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rspec/core/formatters/j_unit_formatter.rb +3 -19
- data/lib/rspec_junit_formatter.rb +5 -1
- metadata +29 -15
@@ -1,9 +1,4 @@
|
|
1
|
-
require
|
2
|
-
|
3
|
-
require "builder"
|
4
|
-
require "rspec"
|
5
|
-
|
6
|
-
require "rspec/core/formatters/base_formatter"
|
1
|
+
require 'time'
|
7
2
|
|
8
3
|
# Dumps rspec results as a JUnit XML file.
|
9
4
|
# Based on XML schema: http://windyroad.org/dl/Open%20Source/JUnit.xsd
|
@@ -21,7 +16,7 @@ class RSpec::Core::Formatters::JUnitFormatter < RSpec::Core::Formatters::BaseFor
|
|
21
16
|
super
|
22
17
|
|
23
18
|
xml.instruct!
|
24
|
-
xml.testsuite :tests => example_count, :failures => failure_count, :errors => 0, :time =>
|
19
|
+
xml.testsuite :tests => example_count, :failures => failure_count, :errors => 0, :time => '%.6f' % duration, :timestamp => @start.iso8601 do
|
25
20
|
xml.properties
|
26
21
|
examples.each do |example|
|
27
22
|
send :"dump_summary_example_#{example.execution_result[:status]}", example
|
@@ -30,7 +25,7 @@ class RSpec::Core::Formatters::JUnitFormatter < RSpec::Core::Formatters::BaseFor
|
|
30
25
|
end
|
31
26
|
|
32
27
|
def xml_example example, &block
|
33
|
-
xml.testcase :classname => example.file_path, :name => example.full_description, :time =>
|
28
|
+
xml.testcase :classname => example.file_path, :name => example.full_description, :time => '%.6f' % example.execution_result[:run_time], &block
|
34
29
|
end
|
35
30
|
|
36
31
|
def dump_summary_example_passed example
|
@@ -53,15 +48,4 @@ class RSpec::Core::Formatters::JUnitFormatter < RSpec::Core::Formatters::BaseFor
|
|
53
48
|
end
|
54
49
|
end
|
55
50
|
end
|
56
|
-
|
57
|
-
private
|
58
|
-
|
59
|
-
# Rspec 2.12 changes the signature of format_backtrace, so we
|
60
|
-
# presume the new version is in play unless we can check that
|
61
|
-
# the loaded gem version is below 2.12
|
62
|
-
if not defined? Gem or Gem.loaded_specs["rspec"].version >= Gem::Version.new("2.12")
|
63
|
-
def format_backtrace backtrace, example
|
64
|
-
super backtrace, example.metadata
|
65
|
-
end
|
66
|
-
end
|
67
51
|
end
|
@@ -1,4 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require 'builder'
|
2
|
+
require 'rspec'
|
3
|
+
|
4
|
+
require 'rspec/core/formatters/base_formatter'
|
5
|
+
require 'rspec/core/formatters/j_unit_formatter'
|
2
6
|
|
3
7
|
# Make it easier to use
|
4
8
|
RspecJunitFormatter = RSpecJUnitFormatter = RSpec::Core::Formatters::JUnitFormatter
|
metadata
CHANGED
@@ -1,51 +1,66 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec_junit_formatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.3
|
5
4
|
prerelease:
|
5
|
+
version: 0.1.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Samuel Cochran
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
15
|
+
version_requirements: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '2.0'
|
20
|
+
none: false
|
21
|
+
name: rspec
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
|
25
|
-
none: false
|
24
|
+
requirement: !ruby/object:Gem::Requirement
|
26
25
|
requirements:
|
27
26
|
- - ~>
|
28
27
|
- !ruby/object:Gem::Version
|
29
28
|
version: '2.0'
|
29
|
+
none: false
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
|
-
|
31
|
+
version_requirements: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ! '!='
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: 2.12.0
|
36
|
+
none: false
|
37
|
+
name: rspec-core
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
32
40
|
requirement: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ! '!='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 2.12.0
|
33
45
|
none: false
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
version_requirements: !ruby/object:Gem::Requirement
|
34
48
|
requirements:
|
35
49
|
- - ! '>='
|
36
50
|
- !ruby/object:Gem::Version
|
37
51
|
version: '0'
|
52
|
+
none: false
|
53
|
+
name: builder
|
38
54
|
type: :runtime
|
39
55
|
prerelease: false
|
40
|
-
|
41
|
-
none: false
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
42
57
|
requirements:
|
43
58
|
- - ! '>='
|
44
59
|
- !ruby/object:Gem::Version
|
45
60
|
version: '0'
|
61
|
+
none: false
|
46
62
|
description: RSpec results that Hudson can read.
|
47
|
-
email:
|
48
|
-
- sj26@sj26.com
|
63
|
+
email: sj26@sj26.com
|
49
64
|
executables: []
|
50
65
|
extensions: []
|
51
66
|
extra_rdoc_files: []
|
@@ -61,17 +76,17 @@ rdoc_options: []
|
|
61
76
|
require_paths:
|
62
77
|
- lib
|
63
78
|
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
-
none: false
|
65
79
|
requirements:
|
66
80
|
- - ! '>='
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '0'
|
69
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
83
|
none: false
|
84
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
85
|
requirements:
|
72
86
|
- - ! '>='
|
73
87
|
- !ruby/object:Gem::Version
|
74
88
|
version: 1.3.6
|
89
|
+
none: false
|
75
90
|
requirements: []
|
76
91
|
rubyforge_project:
|
77
92
|
rubygems_version: 1.8.23
|
@@ -79,4 +94,3 @@ signing_key:
|
|
79
94
|
specification_version: 3
|
80
95
|
summary: RSpec JUnit XML formatter
|
81
96
|
test_files: []
|
82
|
-
has_rdoc:
|