Class: GherkinReporter
- Inherits:
-
Object
- Object
- GherkinReporter
- 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
-
#file_path ⇒ Object
Returns the value of attribute file_path.
-
#workbook ⇒ Object
Returns the value of attribute workbook.
Attributes included from LoggerSetup
Instance Method Summary collapse
-
#initialize(writer, model, path, file_name = nil) ⇒ GherkinReporter
constructor
A new instance of GherkinReporter.
- #old_write ⇒ Object
- #write ⇒ Object
Methods included from LoggerSetup
#init_logger, reset_appender_log_levels
Constructor Details
#initialize(writer, model, path, 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, path, file_name = nil) init_logger @writer = writer @model = model @file_path = FileHelper.file_path(path, "#{LOG_TIME_NOW}_#{file_name}") @log.info "Report file => #{@file_name}#{@writer.ext}" end |
Instance Attribute Details
#file_path ⇒ Object
Returns the value of attribute file_path.
11 12 13 |
# File 'lib/cuker/gherkin_reporter.rb', line 11 def file_path @file_path end |
#workbook ⇒ Object
Returns the value of attribute workbook.
11 12 13 |
# File 'lib/cuker/gherkin_reporter.rb', line 11 def workbook @workbook end |
Instance Method Details
#old_write ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/cuker/gherkin_reporter.rb', line 27 def old_write # todo: why don't we just give the writer the model? file_name = @writer.make_new_file @file_path #todo: redo, causing issue! @writer.write_title @model.title @model.data.each {|row| @writer.write_new_row row} @writer.finishup file_name end |
#write ⇒ Object
23 24 25 |
# File 'lib/cuker/gherkin_reporter.rb', line 23 def write @writer.write @model, @file_path end |