Module: Cuporter::Formatters::Csv
Constant Summary
collapse
- COMMA =
","
Instance Method Summary
collapse
Methods included from Util
depth, terminal_width
build_line, dir, example, example_header, examples, feature, file, report, scenario, scenario_outline, tag
Instance Method Details
#blank_for_number(node) ⇒ Object
29
30
31
|
# File 'lib/cuporter/formatters/csv.rb', line 29
def blank_for_number(node)
"#{tab_stop * depth(node)},"
end
|
#cuke_name(value) ⇒ Object
33
34
35
|
# File 'lib/cuporter/formatters/csv.rb', line 33
def cuke_name(value)
"#{value ? value.unescape_apostrophe : nil},"
end
|
#example_name(name) ⇒ Object
56
57
58
59
60
|
# File 'lib/cuporter/formatters/csv.rb', line 56
def example_name(name)
name.sub!(/^\s*\|/, '')
name.sub!(/\|\s*$/, '')
name.gsub(/\|/,";")
end
|
#file_path(value, length = nil) ⇒ Object
46
47
48
49
|
# File 'lib/cuporter/formatters/csv.rb', line 46
def file_path(value, length = nil)
return "" unless value
"#{value},"
end
|
#fs_name(value) ⇒ Object
37
38
39
|
# File 'lib/cuporter/formatters/csv.rb', line 37
def fs_name(value)
"#{value.upcase},"
end
|
#number(node) ⇒ Object
24
25
26
27
|
# File 'lib/cuporter/formatters/csv.rb', line 24
def number(node)
n = node['number'] ? "#{node['number']})," : COMMA
"#{tab_stop * depth(node)}#{n}"
end
|
#tab_stop ⇒ Object
11
12
13
|
# File 'lib/cuporter/formatters/csv.rb', line 11
def tab_stop
@@tab_stop ||= COMMA
end
|
41
42
43
44
|
# File 'lib/cuporter/formatters/csv.rb', line 41
def tags(value)
return "" unless value
"#{value},"
end
|
#title(value) ⇒ Object
51
52
53
54
|
# File 'lib/cuporter/formatters/csv.rb', line 51
def title(value)
return "" unless value
"#{value},"
end
|
#total(node) ⇒ Object
19
20
21
22
|
# File 'lib/cuporter/formatters/csv.rb', line 19
def total(node)
t = node['total'] ? "[#{node['total']}]," : COMMA
"#{tab_stop * depth(node)}#{t}"
end
|
#total_column_spacer ⇒ Object
15
16
17
|
# File 'lib/cuporter/formatters/csv.rb', line 15
def total_column_spacer
@@total_column_spacer ||= NodeFormatters.total ? tab_stop : ""
end
|