Skip to content

Commit

Permalink
Updated failure tag's text content in junit reporter.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikoto2000 committed Jun 3, 2023
1 parent 89ae2ee commit 9ef15e2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ erblint --format junit
</properties>
<testcase name="app/views/subscriptions/_loader.html.erb" file="app/views/subscriptions/_loader.html.erb" lineno="1">
<failure message="SpaceInHtmlTag: Extra space detected where there should be no space." type="SpaceInHtmlTag">
<![CDATA[app/views/subscriptions/_loader.html.erb:1:7]]>
<![CDATA[SpaceInHtmlTag: Extra space detected where there should be no space. at app/views/subscriptions/_loader.html.erb:1:7]]>
</failure>
</testcase>
<testcase name="app/views/application/index.html.erb" file="app/views/subscriptions/_menu.html.erb"/>
Expand Down
2 changes: 1 addition & 1 deletion lib/erb_lint/reporters/junit_reporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def create_failure(filename, offense)
failure_element.add_attribute("message", "#{type}: #{message}")
failure_element.add_attribute("type", type.to_s)

cdata_element = REXML::CData.new("#{filename}:#{offense.line_number}:#{offense.column}")
cdata_element = REXML::CData.new("#{type}: #{message} at #{filename}:#{offense.line_number}:#{offense.column}")
failure_element.add_text(cdata_element)

failure_element
Expand Down
4 changes: 2 additions & 2 deletions spec/erb_lint/fixtures/junit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
</properties>
<testcase name="app/views/subscriptions/_loader.html.erb" file="app/views/subscriptions/_loader.html.erb" lineno="1">
<failure message="SpaceInHtmlTag: Extra space detected where there should be no space." type="SpaceInHtmlTag">
<![CDATA[app/views/subscriptions/_loader.html.erb:1:7]]>
<![CDATA[SpaceInHtmlTag: Extra space detected where there should be no space. at app/views/subscriptions/_loader.html.erb:1:7]]>
</failure>
</testcase>
<testcase name="app/views/subscriptions/_loader.html.erb" file="app/views/subscriptions/_loader.html.erb" lineno="52">
<failure message="ClosingErbTagIndent: Remove newline before `%%&gt;` to match start of tag." type="ClosingErbTagIndent">
<![CDATA[app/views/subscriptions/_loader.html.erb:52:10]]>
<![CDATA[ClosingErbTagIndent: Remove newline before `%%>` to match start of tag. at app/views/subscriptions/_loader.html.erb:52:10]]>
</failure>
</testcase>
<testcase name="app/views/application/index.html.erb" file="app/views/application/index.html.erb"/>
Expand Down

0 comments on commit 9ef15e2

Please sign in to comment.