Skip to content
Snippets Groups Projects
Commit f0e01a05 authored by Jack Nagel's avatar Jack Nagel
Browse files

Use add_attribute method instead of accessing attributes hash

parent b9474dfc
No related branches found
No related tags found
No related merge requests found
......@@ -679,16 +679,18 @@ module Homebrew
if ARGV.include? "--junit"
xml_document = REXML::Document.new
xml_document << REXML::XMLDecl.new
testsuites = xml_document.add_element 'testsuites'
testsuites = xml_document.add_element "testsuites"
tests.each do |test|
testsuite = testsuites.add_element 'testsuite'
testsuite.attributes['name'] = "brew-test-bot.#{MacOS.cat}"
testsuite.attributes['tests'] = test.steps.count
testsuite = testsuites.add_element "testsuite"
testsuite.add_attribute "name", "brew-test-bot.#{MacOS.cat}"
testsuite.add_attribute "tests", test.steps.count
test.steps.each do |step|
testcase = testsuite.add_element 'testcase'
testcase.attributes['name'] = step.command_short
testcase.attributes['status'] = step.status
testcase.attributes['time'] = step.time
testcase = testsuite.add_element "testcase"
testcase.add_attribute "name", step.command_short
testcase.add_attribute "status", step.status
testcase.add_attribute "time", step.time
if step.has_output?
# Remove invalid XML CData characters from step output.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment