Class: GherkinReporter

Inherits:
Object
  • Object
show all
Includes:
LoggerSetup
Defined in:
lib/cuker/gherkin_reporter.rb

Overview

Write to Reports

to write out all your parsed gherkins by tags etc.. uses gem ‘writeexcel’

Instance Attribute Summary collapse

Attributes included from LoggerSetup

#log

Instance Method Summary collapse

Methods included from LoggerSetup

#init_logger, reset_appender_log_levels

Constructor Details

#initialize(writer, model, loc, file_name = nil) ⇒ GherkinReporter

Returns a new instance of GherkinReporter.



13
14
15
16
17
18
19
20
21
# File 'lib/cuker/gherkin_reporter.rb', line 13

def initialize(writer, model, loc, file_name = nil)
  init_logger

  @writer = writer
  @model = model

  @file_path = FileHelper.file_path(loc, "#{LOG_TIME_NOW}_#{file_name}")
  @log.info "Report file => #{@file_name}#{@writer.ext}"
end

Instance Attribute Details

#file_pathObject

Returns the value of attribute file_path.



11
12
13
# File 'lib/cuker/gherkin_reporter.rb', line 11

def file_path
  @file_path
end

#workbookObject

Returns the value of attribute workbook.



11
12
13
# File 'lib/cuker/gherkin_reporter.rb', line 11

def workbook
  @workbook
end

Instance Method Details

#writeObject



23
24
25
26
27
28
# File 'lib/cuker/gherkin_reporter.rb', line 23

def write
  @writer.make_file @file_path
  @writer.write_title @model.title
  @model.data.each {|row| @writer.write_new_row row}
  @file_path
end