Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 4 additions & 10 deletions lib/cucumber/formatter/message_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,10 @@ def on_gherkin_source_parsed(_event)
# TODO: Handle GherkinSourceParsed
end

def on_gherkin_source_read(event)
message = Cucumber::Messages::Envelope.new(
source: Cucumber::Messages::Source.new(
uri: event.path,
data: event.body,
media_type: 'text/x.cucumber.gherkin+plain'
)
)

output_envelope(message)
def on_gherkin_source_read(_event)
:no_op
# This is now emitted at the required source (Single event listener - cucumber/runtime.rb#features)
# It does not need to be emitted here as well
end

def on_hook_test_step_created(event)
Expand Down
13 changes: 13 additions & 0 deletions lib/cucumber/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,19 @@ def features
@features ||= feature_files.map do |path|
source = NormalisedEncodingFile.read(path)
@configuration.notify :gherkin_source_read, path, source

# TODO: Move this into `Cucumber::Core::Gherkin::Document#to_envelope`
to_envelope =
Cucumber::Messages::Envelope.new(
source: Cucumber::Messages::Source.new(
uri: path,
data: source,
media_type: 'text/x.cucumber.gherkin+plain'
)
)

@configuration.notify :envelope, to_envelope

Cucumber::Core::Gherkin::Document.new(path, source)
end
end
Expand Down