class Juniter::TestResult

Constants

ELEMENT_TO_STATUS_MAP
VALID_STATUSES

Attributes

status[R]

Public Class Methods

from_xml(node) click to toggle source
# File lib/juniter/test_result.rb, line 12
def from_xml(node)
  status = ELEMENT_TO_STATUS_MAP.fetch(node.value, node.value)
  new(status).tap do |element|
    element.assign_attributes_from_xml(node)
    element.assign_children_from_xml(node.nodes)
  end
end
new(status) click to toggle source
# File lib/juniter/test_result.rb, line 21
def initialize(status)
  self.status = status.to_sym
end

Public Instance Methods

status=(value) click to toggle source
# File lib/juniter/test_result.rb, line 27
def status=(value)
  raise ArgumentError, "Unknown status. Must be one of: #{VALID_STATUSES.join(", ")}" unless VALID_STATUSES.include?(value)
  @status = value
end
tag() click to toggle source
# File lib/juniter/test_result.rb, line 37
def tag
  ELEMENT_TO_STATUS_MAP.invert.fetch(status, status.to_s)
end
to_xml() click to toggle source
Calls superclass method Juniter::Element#to_xml
# File lib/juniter/test_result.rb, line 32
def to_xml
  return nil if pass?
  super
end