Class: Qcumberless::Formatter

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

Instance Method Summary collapse

Constructor Details

#initialize(step_mother, path_or_io, options) ⇒ Formatter

Returns a new instance of Formatter.



5
6
# File 'lib/qcumberless/formatter.rb', line 5

def initialize(step_mother, path_or_io, options)
end

Instance Method Details

#after_table_row(table_row) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
# File 'lib/qcumberless/formatter.rb', line 43

def after_table_row(table_row)
  print("\n")
  unless @header_row
    if table_row.exception
      print("Step failed: " + table_row.exception + "\n")
    #elsif table_row.status == :undefined
    #  print("Step failed: Step undefined\n")
    end
  end
  @header_row = false if @header_row
end

#before_outline_table(outline_table) ⇒ Object



30
31
32
33
# File 'lib/qcumberless/formatter.rb', line 30

def before_outline_table(outline_table)
  print("Outline table\n")
  @header_row = true
end

#before_step(step) ⇒ Object



16
17
18
# File 'lib/qcumberless/formatter.rb', line 16

def before_step(step)
  print("Step: " + step.name + "\n")
end

#before_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background, file_colon_line) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/qcumberless/formatter.rb', line 20

def before_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background, file_colon_line)
  if exception
    print("Step failed: " + exception + "\n")
  elsif status == :undefined
    print("Step failed: Step undefined\n")
  else
    print("Step success\n")
  end
end

#before_table_row(table_row) ⇒ Object



35
36
37
# File 'lib/qcumberless/formatter.rb', line 35

def before_table_row(table_row)
  printf("Table row: |")
end

#feature_name(keyword, name) ⇒ Object



8
9
10
# File 'lib/qcumberless/formatter.rb', line 8

def feature_name(keyword, name)
  print("Feature: " + name + "\n")
end

#scenario_name(keyword, name, file_colon_line, source_indent) ⇒ Object



12
13
14
# File 'lib/qcumberless/formatter.rb', line 12

def scenario_name(keyword, name, file_colon_line, source_indent)
  print("Scenario: " + name + "\n")
end

#table_cell_value(value, status) ⇒ Object



39
40
41
# File 'lib/qcumberless/formatter.rb', line 39

def table_cell_value(value, status)
  print(value.to_s + "|")
end