lib/junit_model/xml.rb in junit_model-0.1.0 vs lib/junit_model/xml.rb in junit_model-0.1.1

- old
+ new

@@ -6,15 +6,21 @@ def self.xml_for_result(result) builder = Builder::XmlMarkup.new indent: 2 builder.instruct! :xml, version: '1.0', encoding: 'UTF-8' builder.testsuites(tests: result.test_count, failures: result.failures_count) do |suite_builder| result.test_suites.each do |suite| - suite_builder.testsuite(name: suite.name, tests: suite.tests, failures: suite.failures) do |test_builder| + suite_builder.testsuite(suite_hash(suite)) do |test_builder| suite.test_cases.each do |test_case| - test_builder.testcase(classname: test_case.classname, name: test_case.name, time: test_case.time) + test_builder.testcase(test_case.to_h) end end end end + end + + def self.suite_hash(suite) + suite_hash = suite.to_h + suite_hash.delete(:testcase) + suite_hash end end end