Class: PactJUnitFormatter::ExampleDumper

Inherits:
Object
  • Object
show all
Defined in:
lib/pact_junit_formatter.rb

Instance Method Summary collapse

Constructor Details

#initialize(xml, example) ⇒ ExampleDumper

Returns a new instance of ExampleDumper.



50
51
52
53
# File 'lib/pact_junit_formatter.rb', line 50

def initialize(xml, example)
  @xml = xml
  @example = example
end

Instance Method Details

#callObject



55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/pact_junit_formatter.rb', line 55

def call
  case @example.status
  when :passed
    dump_example(@example)
  when :pending
    dump_pending(@example)
  when :failed
    dump_failed(@example)
  else
    raise "Unexpected example status: #{@example.status}"
  end
end