Skip to content

BEFORE_ALL and AFTER_ALL macros #65

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

Merged
merged 13 commits into from
Nov 17, 2013

Conversation

larryprice
Copy link
Contributor

Why: When using Capybara for Ruby projects, I was able to use the concept of before_all from rspec to perform a specific action before any of my scenarios ran. While my team was using cucumber-cpp, we noticed that this concept didn't exist and had to resort to using tags to mark scenarios as @first and @last to spin up/down a library that could only be started/stopped once per executable.

How: Added equivalent macros. In CukeCommands, stored a state boolean to figure out when the first scenario occurred. The body of any BEFORE_ALL macro is executed before the first scenario runs. If any scenarios were run, the body of any AFTER_ALL macro is executed when the CukeCommands class is being torn down.

paoloambrosio added a commit that referenced this pull request Nov 17, 2013
@paoloambrosio paoloambrosio merged commit 26e11d0 into cucumber:master Nov 17, 2013
@paoloambrosio
Copy link
Member

Thanks for the contribution. Excellent pull request.

Sorry it took me some time but I was stuck on issue #68

paoloambrosio added a commit that referenced this pull request Nov 17, 2013
@larryprice larryprice deleted the BeforeAllAfterAll branch November 18, 2013 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants