Class: Cucumber::Formatter::Message
- Inherits:
-
Object
- Object
- Cucumber::Formatter::Message
- Includes:
- Io
- Defined in:
- lib/cucumber/formatter/message.rb
Overview
The formatter used for --format message
Instance Method Summary collapse
-
#initialize(config) ⇒ Message
constructor
A new instance of Message.
- #output_envelope(event) ⇒ Object
Methods included from Io
ensure_dir, ensure_file, ensure_io, included, io?, url?
Constructor Details
#initialize(config) ⇒ Message
Returns a new instance of Message.
11 12 13 14 |
# File 'lib/cucumber/formatter/message.rb', line 11 def initialize(config) @io = ensure_io(config.out_stream, config.error_stream) config.on_event :envelope, &method(:output_envelope) end |
Instance Method Details
#output_envelope(event) ⇒ Object
16 17 18 19 20 |
# File 'lib/cucumber/formatter/message.rb', line 16 def output_envelope(event) envelope = event.envelope @io.write(envelope.to_json) @io.write("\n") end |