Start the event bus after all listeners are registered #1059
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
To make sure that all listeners will receive all events broadcasted through the event bus, start the event bus only after all listeners have had a change so register themselves with the event bus.
One case where this is important is so that the usage formatter get to know all step definitions that are registered, even though the step definitions are registered before the formatters have been created.
Details
Revert changes in file loading from #977, so that the support and step definition files again are loaded at the same time (before the formatters has been created).
Call
EventBus#start
after all formatters and other event bus listeners have been created and had a change to register themselves with the event bus.Requires cucumber/cucumber-ruby-core#117.
Motivation and Context
Fixes #1041.
How Has This Been Tested?
The current
usage_formatter.feature
verifies that the step definitions loaded before the usage/stepdefs formatter has registered itself with the event bus are reported by the usage/stepdefs formatter.Types of changes
Checklist: