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

Around hooks not executing in correct world context #807

Merged
merged 2 commits into from
Mar 18, 2015

Conversation

tooky
Copy link
Member

@tooky tooky commented Feb 13, 2015

This supersedes #640.

Based on @maxlinc's example this scenario demonstrates that the world an around hook is being instance_exec'd on is not quite right.

For the first scenario, self is nil, and the next scenario the world is remembered from the previous scenario.

@tooky
Copy link
Member Author

tooky commented Feb 17, 2015

@mattwynne using an around hook to prepare the world has changed the way some of the errors are reported. Is there anything that jumps out as something we need to do to change this?

The problem with preparing the world in a before hook is that they run after any around hooks, so the world that the rest of the test case is executed against has not been initialised yet.

@mattwynne mattwynne added the 🐛 bug Defect / Bug label Mar 13, 2015
@mattwynne mattwynne force-pushed the hooks-inconsistent-world branch 2 times, most recently from 41d2337 to 32a1a9f Compare March 16, 2015 21:26
@mattwynne
Copy link
Member

@tooky I think this is good to go. Can you tidy up the commits and merge (or use --squash) if you agree?

maxlinc and others added 2 commits March 18, 2015 20:04
This ensures that prepare world is the first thing that is
run for a test case, preventing the inconsistency with what the world _is_
in around hooks.

Legacy adapter requires each test case to have a test step otherwise it
doesn't switch step container and messages get lost.

Also ensures failures in Around hooks are reported.
tooky added a commit that referenced this pull request Mar 18, 2015
Execute around hooks correctly within the world
@tooky tooky merged commit 1596f55 into master Mar 18, 2015
@tooky tooky deleted the hooks-inconsistent-world branch March 18, 2015 20:45
@mattwynne
Copy link
Member

thanks @tooky!

@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
🐛 bug Defect / Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants