Skip to content

Commit 3903b70

Browse files
hanneskaeuflerRX14
authored andcommittedJan 2, 2018
Rename 'failed' to 'failures' in junit output. (#5463)
The junit formatter output contains the 'failed' attribute on the testsuite node, which must be called 'failures'.
1 parent 80f94f3 commit 3903b70

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
 

‎spec/std/spec/junit_formatter_spec.cr

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe "JUnit Formatter" do
99

1010
expected = <<-XML
1111
<?xml version="1.0"?>
12-
<testsuite tests="2" errors="0" failed="0">
12+
<testsuite tests="2" errors="0" failures="0">
1313
<testcase file=\"spec/some_spec.cr\" classname=\"spec.some_spec\" name="should do something"/>
1414
<testcase file=\"spec/some_spec.cr\" classname=\"spec.some_spec\" name="should do something else"/>
1515
</testsuite>
@@ -25,7 +25,7 @@ describe "JUnit Formatter" do
2525

2626
expected = <<-XML
2727
<?xml version="1.0"?>
28-
<testsuite tests="1" errors="0" failed="1">
28+
<testsuite tests="1" errors="0" failures="1">
2929
<testcase file=\"spec/some_spec.cr\" classname=\"spec.some_spec\" name="should do something">
3030
<failure/>
3131
</testcase>
@@ -42,7 +42,7 @@ describe "JUnit Formatter" do
4242

4343
expected = <<-XML
4444
<?xml version="1.0"?>
45-
<testsuite tests="1" errors="1" failed="0">
45+
<testsuite tests="1" errors="1" failures="0">
4646
<testcase file=\"spec/some_spec.cr\" classname=\"spec.some_spec\" name="should do something">
4747
<error/>
4848
</testcase>
@@ -62,7 +62,7 @@ describe "JUnit Formatter" do
6262

6363
expected = <<-XML
6464
<?xml version="1.0"?>
65-
<testsuite tests="4" errors="2" failed="1">
65+
<testsuite tests="4" errors="2" failures="1">
6666
<testcase file=\"spec/some_spec.cr\" classname=\"spec.some_spec\" name="should do something1"/>
6767
<testcase file=\"spec/some_spec.cr\" classname=\"spec.some_spec\" name="should do something2">
6868
<failure/>

‎src/spec/junit_formatter.cr

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ module Spec
3030

3131
XML.build(io, indent: 2) do |xml|
3232
attributes = {
33-
tests: @results.size,
34-
errors: @summary[:error]? || 0,
35-
failed: @summary[:fail]? || 0,
33+
tests: @results.size,
34+
errors: @summary[:error]? || 0,
35+
failures: @summary[:fail]? || 0,
3636
}
3737

3838
xml.element("testsuite", attributes) do

0 commit comments

Comments
 (0)
Please sign in to comment.