-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
@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. |
fdfa55c
to
9c4b282
Compare
9c4b282
to
6438302
Compare
41d2337
to
32a1a9f
Compare
@tooky I think this is good to go. Can you tidy up the commits and merge (or use --squash) if you agree? |
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.
32a1a9f
to
1f3714d
Compare
Execute around hooks correctly within the world
thanks @tooky! |
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. |
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.