Class: Cucumber::Formatter::HTML

Inherits:
MessageBuilder show all
Includes:
Io
Defined in:
lib/cucumber/formatter/html.rb

Instance Method Summary collapse

Methods included from Io

ensure_dir, ensure_file, ensure_io, included, io?, url?

Methods inherited from MessageBuilder

#attach, #output_message

Constructor Details

#initialize(config) ⇒ HTML

Returns a new instance of HTML.



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

def initialize(config)
  @io = ensure_io(config.out_stream, config.error_stream)
  @html_formatter = Cucumber::HTMLFormatter::Formatter.new(@io)
  @html_formatter.write_pre_message

  super(config)
end

Instance Method Details

#output_envelope(envelope) ⇒ Object



20
21
22
23
# File 'lib/cucumber/formatter/html.rb', line 20

def output_envelope(envelope)
  @html_formatter.write_message(envelope)
  @html_formatter.write_post_message if envelope.test_run_finished
end