Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions features/docs/formatters/html.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ Feature: html formatter
When I run `cucumber features/my_feature.feature --format html`
Then it should fail
And output should be html with title "Cucumber"
And the output should contain:
"""
Scenario Outline: a scenario
"""
10 changes: 6 additions & 4 deletions lib/cucumber/formatter/html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@

require 'cucumber/html_formatter'

require_relative 'message_builder'
require_relative 'io'

module Cucumber
module Formatter
class HTML < MessageBuilder
class HTML
include Io

def initialize(config)
@config = config
@io = ensure_io(config.out_stream, config.error_stream)
@html_formatter = Cucumber::HTMLFormatter::Formatter.new(@io)
@html_formatter.write_pre_message
super(config)
config.on_event :envelope, &method(:on_envelope)
end

def on_envelope(event)
super(event)
envelope = event.envelope
@html_formatter.write_message(envelope)
# TODO: Move this conditional logic into the HTML formatter proper
Expand Down