Class: ATP::Formatters::Basic

Inherits:
ATP::Formatter show all
Defined in:
lib/atp/formatters/basic.rb

Overview

Returns the executed flow as a string of test names. This is mainly intended to be used for testing the runner.

Instance Method Summary collapse

Methods inherited from ATP::Formatter

format, run, #run_and_format, run_and_format

Methods inherited from Processor

#handler_missing, #n, #n0, #n1, #process, #run

Instance Method Details

#format(node, options = {}) ⇒ Object



6
7
8
9
10
# File 'lib/atp/formatters/basic.rb', line 6

def format(node, options = {})
  @output = ''
  process(node)
  @output
end

#on_set_result(node) ⇒ Object



22
23
24
25
26
27
# File 'lib/atp/formatters/basic.rb', line 22

def on_set_result(node)
  @output += node.to_a[0].upcase
  @output += " #{node.find(:bin).value}" if node.find(:bin)
  @output += " #{node.find(:softbin).value}" if node.find(:softbin)
  @output += "\n"
end

#on_test(node) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/atp/formatters/basic.rb', line 12

def on_test(node)
  if node.find(:name)
    @output += node.find(:name).value
  else
    @output += node.find(:object).value['Test']
  end
  @output += ' F' if node.find(:failed)
  @output += "\n"
end