Skip to content
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

Merged
merged 2 commits into from
Jul 1, 2016

Conversation

brasmusson
Copy link
Contributor

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).

module Events

# Event fired after each step definition has been loaded
class StepDefinitionLoaded
Copy link
Member

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?

Copy link
Contributor Author

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.

@mattwynne
Copy link
Member

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 👍

@brasmusson
Copy link
Contributor Author

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.
@brasmusson brasmusson force-pushed the progress-formatter-use-events branch from 8688879 to eb275bf Compare June 13, 2016 16:37
@mattwynne mattwynne modified the milestone: 3.0 Jul 1, 2016
@mattwynne mattwynne merged commit cc7eb89 into master Jul 1, 2016
richarda pushed a commit to richarda/cucumber that referenced this pull request Jul 1, 2016
…#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.
@brasmusson brasmusson deleted the progress-formatter-use-events branch July 1, 2016 16:25
mattwynne added a commit that referenced this pull request Jun 24, 2017
@lock
Copy link

lock bot commented Oct 25, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants