Module: Cuporter::Formatters::TextMethods

Included in:
Csv, Text
Defined in:
lib/cuporter/formatters/text_methods.rb

Instance Method Summary collapse

Instance Method Details

#writeObject



6
7
8
9
10
11
# File 'lib/cuporter/formatters/text_methods.rb', line 6

def write
  @report.children.each do |tag_node|
    tag_node.number_all_descendants if @number_scenarios
    write_node(tag_node, 0)
  end
end

#write_node(node, tab_stops) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/cuporter/formatters/text_methods.rb', line 13

def write_node(node, tab_stops)
  @output.puts line(node.number, "#{tab * tab_stops}#{node.name}")
  node.children.each do |child|
    if child.has_children?
      write_node(child, tab_stops + 1)
    else
      @output.puts line(child.number, "#{tab * tab_stops}#{tab }#{child.name}")
    end
  end
end