Module: Cuporter::Formatters::NodeFormatters

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

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.text_summaryObject

Returns the value of attribute text_summary.



18
19
20
# File 'lib/cuporter/formatters/text.rb', line 18

def text_summary
  @text_summary
end

.totalObject

Returns the value of attribute total.



18
19
20
# File 'lib/cuporter/formatters/text.rb', line 18

def total
  @total
end

Instance Method Details

#build_line(node) ⇒ Object



85
86
87
88
89
90
91
# File 'lib/cuporter/formatters/text.rb', line 85

def build_line(node)
  l = send(node.name.to_sym, "", node)
  l += "\n" unless l.empty?
  l
rescue NoMethodError
  ""
end

#dir(l, node) ⇒ Object



28
29
30
31
32
# File 'lib/cuporter/formatters/text.rb', line 28

def dir(l, node)
  l += total(node)
  l += fs_name(node['fs_name'])
  l
end

#example(l, node) ⇒ Object



77
78
79
80
81
82
83
# File 'lib/cuporter/formatters/text.rb', line 77

def example(l, node)
  l += total_column_spacer
  l += number(node)
  l += example_name(node['cuke_name'])
  l += tags(node['tags'])
  l
end

#example_header(l, node) ⇒ Object



70
71
72
73
74
75
76
# File 'lib/cuporter/formatters/text.rb', line 70

def example_header(l, node)
  l += total_column_spacer
  l += blank_for_number(node)
  l += example_name(node['cuke_name'])
  l += tags(node['tags'])
  l
end

#examples(l, node) ⇒ Object



63
64
65
66
67
68
69
# File 'lib/cuporter/formatters/text.rb', line 63

def examples(l, node)
  l += total_column_spacer
  l += normal_indent(node)
  l += cuke_name(node['cuke_name'])
  l += tags(node['tags'])
  l
end

#feature(l, node) ⇒ Object



43
44
45
46
47
48
49
# File 'lib/cuporter/formatters/text.rb', line 43

def feature(l, node)
  l += total(node)
  l += cuke_name(node['cuke_name'])
  l += tags(node['tags'])
  l += file_path(node['file_path'], l.size)
  l
end

#file(l, node) ⇒ Object



33
34
35
36
37
# File 'lib/cuporter/formatters/text.rb', line 33

def file(l, node)
  l += total(node)
  l += fs_name(node['fs_name'])
  l
end

#report(l, node) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/cuporter/formatters/text.rb', line 21

def report(l, node)
  return l unless NodeFormatters.text_summary
  l += total(node)
  l += cuke_name(node['cuke_name'])
  l += title(node['title'])
  l
end

#scenario(l, node) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/cuporter/formatters/text.rb', line 50

def scenario(l, node)
  l += total_column_spacer
  l += number(node)
  l += cuke_name(node['cuke_name'])
  l += tags(node['tags'])
  l
end

#scenario_outline(l, node) ⇒ Object



57
58
59
60
61
62
# File 'lib/cuporter/formatters/text.rb', line 57

def scenario_outline(l, node)
  l += total(node)
  l += cuke_name(node['cuke_name'])
  l += tags(node['tags'])
  l
end

#tag(l, node) ⇒ Object



38
39
40
41
42
# File 'lib/cuporter/formatters/text.rb', line 38

def tag(l, node)
  l += total(node)
  l += cuke_name(node['cuke_name'])
  l
end