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

Make the scenario object available in hooks compatible with v1.3.x #814

Closed
wants to merge 2 commits into from

Conversation

brasmusson
Copy link
Contributor

#768 identified that the scenario.name of the scenario object available in hooks includes the keyword, which makes it different compared to the case in v1.3.x. Unfortunately, also after the changes triggered by #768, the keyword is still included in scenario.name (see the before_hook.feature).

In case of Scenario Outlines, achieving full compatibility with v1.3.x is rather complicated as in that case scenario.name is cell values for the example row, and scenario.scenario_outline.name is the name of the Scenario Outline. The name of the test_case is neither, it is <scenario outline name>, <examples table name> (row <nr>).

The name of the test_case is in a sense quite informative, so it raises the question of how important backward compatibility is in this specific case.

@mattwynne mattwynne modified the milestone: 2.0 Mar 10, 2015
@mattwynne
Copy link
Member

IMO the scenario.name in the hook should be the test case's name.

People need to get used to thinking of that thing as a test case anyway.

@mattwynne
Copy link
Member

See also #430

@brasmusson brasmusson force-pushed the compatability-in-hooks branch from 26626e1 to 6957b52 Compare March 17, 2015 19:39
@brasmusson
Copy link
Contributor Author

I pushed up the change everyone agree on to the master (cucumber/common@eb950d1), that the keyword should not be part of the name exposed to the hooks.

I leave the PR open (rebased) as a place holder for the discussion if we should opt for exact compatibility with v1.3.x, and if not, whether the example row cell values should be make available to hooks (in v1.3.x they are part of the name).

@mattwynne
Copy link
Member

I think we should expose the cell values, but through their own attributes.

@brasmusson
Copy link
Contributor Author

Maybe with a method cell_values on ScenarioOutlineExample, that returns what Cucumber::Core::Ast::ExampleTrable::Row.values returns.

mattwynne added a commit that referenced this pull request Mar 18, 2015
@mattwynne
Copy link
Member

I say we close this and don't merge. Any objections?

@brasmusson
Copy link
Contributor Author

No objection.

@brasmusson brasmusson closed this Mar 19, 2015
@brasmusson brasmusson deleted the compatability-in-hooks branch March 19, 2015 08:04
@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