Skip to content

Commit

Permalink
Report number of pending specs (as “disabled”) in Spec::JUnitFormatter
Browse files Browse the repository at this point in the history
  • Loading branch information
Sija committed Dec 19, 2019
1 parent c4bc389 commit 67ea6ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/std/spec/junit_formatter_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe "JUnit Formatter" do

expected = <<-XML
<?xml version="1.0"?>
<testsuite tests="2" errors="0" failures="0" time="0.0">
<testsuite tests="2" disabled="0" errors="0" failures="0" time="0.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>
Expand All @@ -26,7 +26,7 @@ describe "JUnit Formatter" do

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

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

expected = <<-XML
<?xml version="1.0"?>
<testsuite tests="4" errors="2" failures="1" time="0.0">
<testsuite tests="4" disabled="0" errors="2" failures="1" time="0.0">
<testcase file="spec/some_spec.cr" classname="spec.some_spec" name="should do something1" time="2.0"/>
<testcase file="spec/some_spec.cr" classname="spec.some_spec" name="should do something2" time="0.5">
<failure/>
Expand Down
1 change: 1 addition & 0 deletions src/spec/junit_formatter.cr
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module Spec
io = @io
io.puts %(<?xml version="1.0"?>)
io << %(<testsuite tests=") << @results.size
io << %(" disabled=") << (@summary[:pending]? || 0)
io << %(" errors=") << (@summary[:error]? || 0)
io << %(" failures=") << (@summary[:fail]? || 0)
io << %(" time=") << elapsed_time.to_f
Expand Down

0 comments on commit 67ea6ad

Please sign in to comment.