Class: ReportPortal::Cucumber::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/report_portal/cucumber/formatter.rb

Direct Known Subclasses

ParallelFormatter

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Formatter

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Formatter.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/report_portal/cucumber/formatter.rb', line 7

def initialize(config)
  ENV['REPORT_PORTAL_USED'] = 'true'

  setup_message_processing

  @io = config.out_stream

  %i[test_case_started test_case_finished test_step_started test_step_finished test_run_finished].each do |event_name|
    config.on_event event_name do |event|
      process_message(event_name, event)
    end
  end
  config.on_event(:test_run_finished) { finish_message_processing }
end

Instance Method Details

#embed(*args) ⇒ Object



28
29
30
# File 'lib/report_portal/cucumber/formatter.rb', line 28

def embed(*args)
  process_message(:embed, *args)
end

#puts(message) ⇒ Object



22
23
24
25
26
# File 'lib/report_portal/cucumber/formatter.rb', line 22

def puts(message)
  process_message(:puts, message)
  @io.puts(message)
  @io.flush
end