-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change the Progress, Usage and Stepdef formatter use events #977
Conversation
module Events | ||
|
||
# Event fired after each step definition has been loaded | ||
class StepDefinitionLoaded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I like "registered" better than "loaded". WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering that the event is fired in the method register_rb_step_definition
, you are absolutely right.
Great work @brasmusson! I like the use of the new event - I'd been thinking along the same lines, and it's great to see the code for real 👍 |
fbc50ab
to
8688879
Compare
Rebased on top of the (merged) move of events infrastructure to the core. |
Then a listener to the event bus can find out which step definitions were not matched to any step.
Also change Progress, Usage and Stepdef formatter to use the new initialize method signature. The API:s of Cucumber::Formatter::Console and Cucumber::Formatter::Summary are extended, but are backward compatible as they are use both by the Pretty formatter and existing custom formatters.
8688879
to
eb275bf
Compare
…#977) * Add the StepDefinitionRegistered event. Then a listener to the event bus can find out which step definitions were not matched to any step. * Change the Progress, Usage and Stepdef formatter to use events. Also change Progress, Usage and Stepdef formatter to use the new initialize method signature. The API:s of Cucumber::Formatter::Console and Cucumber::Formatter::Summary are extended, but are backward compatible as they are use both by the Pretty formatter and existing custom formatters.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Change the Progress, Usage and Stepdef formatter use events and also the new initialize method signature.
For the Usage formatter to be able to find out which step definitions that were not matched to any step, the StepDefinitionLoaded event is added. This also means that the step definitions are loaded after the AfterConfigurationHooks have been executed and the formatter have been created, whereas the support files are loaded before the AfterConfigurationHooks are executed.
The API:s of Cucumber::Formatter::Console and Cucumber::Formatter::Summary are extended, but are backward compatible as they are use both by the Pretty formatter and existing custom formatters.
To simplify the usage of Cucumber::Core::Test::Result::Summary its API has been extended in cucumber/cucumber-ruby-core@e7fb8b7 (already on master of Cucumber-Ruby-Core).