Class: Cucumber::Formatter::SimpleCSV

Inherits:
Object
  • Object
show all
Includes:
Console, Io
Defined in:
lib/cucumber/formatter/simplecsv.rb

Overview

Simple CSV formatter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(runtime, path_or_io, options) ⇒ SimpleCSV

Returns a new instance of SimpleCSV.



12
13
14
15
16
# File 'lib/cucumber/formatter/simplecsv.rb', line 12

def initialize(runtime, path_or_io, options)
  @runtime = runtime
  @io      = ensure_io(path_or_io)
  @options = options
end

Instance Attribute Details

#runtimeObject (readonly)

Returns the value of attribute runtime.



10
11
12
# File 'lib/cucumber/formatter/simplecsv.rb', line 10

def runtime
  @runtime
end

Instance Method Details

#feature_name(keyword, name) ⇒ Object



18
19
20
21
22
# File 'lib/cucumber/formatter/simplecsv.rb', line 18

def feature_name(keyword, name)
  @feature = "#{keyword}: #{name.split("\n")[0]}"
  @io.puts @feature
  @io.flush
end

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



24
25
26
27
28
# File 'lib/cucumber/formatter/simplecsv.rb', line 24

def scenario_name(keyword, name, file_colon_line, _source_indent)
  @scenario = "#{keyword}: #{name}"
  @io.puts "#{@scenario},#{file_colon_line}"
  @io.flush
end