Skip to content

Commit 7afe485

Browse files
committed
Add failing test
1 parent 2540da6 commit 7afe485

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

ruby/tests/annotate_test.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,4 +406,26 @@
406406

407407
assert_equal 0, status.exitstatus
408408
end
409+
410+
it "handles cdata formatted XML files" do
411+
output, status = Open3.capture2e("#{__dir__}/../bin/annotate", "#{__dir__}/failure-with-cdata/")
412+
413+
assert_equal <<~OUTPUT, output
414+
Parsing junit.xml
415+
--- ❓ Checking failures
416+
There is 1 failure/error 😭
417+
--- ✍️ Preparing annotation
418+
1 error:
419+
420+
<details>
421+
<summary><code>Account#maximum_jobs_added_by_pipeline_changer returns 250 by default in spec.models.account_spec</code></summary>
422+
423+
<code><pre>First line of failure output
424+
Second line of failure output</pre></code>
425+
426+
</details>
427+
OUTPUT
428+
429+
assert_equal 0, status.exitstatus
430+
end
409431
end
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<testsuite name="rspec" tests="2" skipped="0" failures="0" errors="1" time="49.290713" timestamp="2018-04-18T23:29:42+00:00" hostname="626d214475e4">
3+
<testcase classname="spec.models.account_spec" name="Account#maximum_jobs_added_by_pipeline_changer returns 500 if the account is ABC" file="./spec/models/account_spec.rb" time="0.020013"/>
4+
<testcase classname="spec.models.account_spec" name="Account#maximum_jobs_added_by_pipeline_changer returns 250 by default" file="./spec/models/account_spec.rb" time="0.967127">
5+
<error message=" expected: 250 got: 500 (compared using eql?) " type="RSpec::Expectations::ExpectationNotMetError">
6+
<![CDATA[First line of failure output]]>
7+
<![CDATA[Second line of failure output]]>
8+
</error>
9+
</testcase>
10+
</testsuite>

0 commit comments

Comments
 (0)