Skip to content

Commit

Permalink
Rename 'failed' to 'failures' in junit output. (#5463)
Browse files Browse the repository at this point in the history
The junit formatter output contains the 'failed' attribute
on the testsuite node, which must be called 'failures'.
hanneskaeufler authored and RX14 committed Jan 2, 2018
1 parent 80f94f3 commit 3903b70
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions spec/std/spec/junit_formatter_spec.cr
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ describe "JUnit Formatter" do

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

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

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

expected = <<-XML
<?xml version="1.0"?>
<testsuite tests="4" errors="2" failed="1">
<testsuite tests="4" errors="2" failures="1">
<testcase file=\"spec/some_spec.cr\" classname=\"spec.some_spec\" name="should do something1"/>
<testcase file=\"spec/some_spec.cr\" classname=\"spec.some_spec\" name="should do something2">
<failure/>
6 changes: 3 additions & 3 deletions src/spec/junit_formatter.cr
Original file line number Diff line number Diff line change
@@ -30,9 +30,9 @@ module Spec

XML.build(io, indent: 2) do |xml|
attributes = {
tests: @results.size,
errors: @summary[:error]? || 0,
failed: @summary[:fail]? || 0,
tests: @results.size,
errors: @summary[:error]? || 0,
failures: @summary[:fail]? || 0,
}

xml.element("testsuite", attributes) do

0 comments on commit 3903b70

Please sign in to comment.