Class: Hone::Formatters::JUnit

Inherits:
Base
  • Object
show all
Defined in:
lib/hone/formatters/junit.rb

Constant Summary collapse

PRIORITY_TO_TYPE =
{
  hot_cpu: "failure",
  hot_alloc: "failure",
  jit_unfriendly: "failure",
  warm: "failure",
  cold: "skipped",
  unknown: "failure"
}.freeze

Constants included from Filterable

Filterable::PRIORITY_LABELS

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from Filterable

#filter_cold

Constructor Details

This class inherits a constructor from Hone::Formatters::Base

Instance Method Details

#formatObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/hone/formatters/junit.rb', line 15

def format
  require_rexml!
  doc = build_document
  output = +""
  formatter = REXML::Formatters::Pretty.new(2)
  formatter.compact = true
  output << %(<?xml version="1.0" encoding="UTF-8"?>\n)
  formatter.write(doc.root, output)
  output
end