-
-
Notifications
You must be signed in to change notification settings - Fork 760
Shared context / global config before hooks called in wrong order #921
Comments
Hi your gist contains no output so doesn't tell us what you're seeing and what you're expecting. Can you clarify? If you could also try on 2.14.0.rc1 that'd help too. |
@JonRowe I've reproduced using Ruby 2.0.0 and RSpec 2.13.1. For me, and what I believe @maltoe is pointing out is that the expected order should be:
However, with 2.13.1, this doesn't happen:
The issue doesn't happen using RSpec 2.14.0.rc1:
This seems to only be an issue with the outer most |
@cupakromer Exactly. I expect the global Rspec.configure before hook to b executed before the mixed in shared context' one (therefore the instance variable being set). When I include the shared context in a nested describe block, it works as expected, but when I include it in the outer-most describe block, it doesn't. I just tested the thing again using |
Sorry wrong button. |
No it's just an issue with including shared contexts due to the internals of how it works, (ancestry order). Have you tried 2.14.0rc1 ? |
This was fixed in #845, which is in 2.14.0.rc1. Closing. If the fix in 2.14.0.rc1 doesn't work for you, feel free to comment here with an example that doesn't work and we'll be happy to re-open. |
Ah there's the PR I couldn't find ;) |
Hi all,
we're using shared context with metadata inclusion and were surprised to see that the order of before hooks in that shared context and in the global configure block is mixed up depending on at which level we include the shared context. Is this intended behaviour?
See https://gist.github.com/maltoe/5662305 for an example. We're using rspec 2.13.1.
Regards,
Malte
[reposted from rspec/rspec-dev#41]
The text was updated successfully, but these errors were encountered: