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

wip-new-core: Fix embedding for the JSON formatter output #705

Merged
merged 2 commits into from
Jul 25, 2014

Conversation

brasmusson
Copy link
Contributor

In legacy_formatter calls to embed is passed on directly to the formatters. This means that they will arrive to the formatter "out of order" - before the formatter knows which the corresponding step is.

It is possible to make the JSON formatter able to handle such "out of order" calls to embed, but I think it is the responsibility of legacy_formatter not to make such a major change to the call sequence the formatter experience. Therefore the calls to embed from the step definitions is delayed in legacy_formatter until the formatter has been informed of the corresponding step.

The legacy_formatter need to make sure that the embed calls from the
step definitions are not passed to the formatter until it got
information about the corresponding step.
If the scenario is not @Spawn:ed the scenario: "
features/docs/gherkin/background.feature:346 #
Scenario: run a feature with a background that is pending"
fails in the JRuby build on Travis (due to that a full error backtrace
is emitted, so it seems that the -b flag is carried over somehow).
@mattwynne
Copy link
Member

Good work! You're quite right: the main job of the LegacyFormatterAdapter is to get the right messages sent to the formatters in the right order. If you look at the specs for the class, you'll see it's possible to pin down these fixes with tests, too.

@mattwynne mattwynne merged commit 50e9d01 into cucumber:master Jul 25, 2014
@brasmusson brasmusson deleted the json-formatter-embed branch July 26, 2014 07:05
@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