-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Spec hooks #8302
Spec hooks #8302
Conversation
Don't |
@j8r No if you only want to set up things without tearing them down, or the other way around. Plus |
@asterite I think having to call |
Okay, this is ready for review. I did a bunch of refactors too. Now the two |
Also: - rename `NestedContext` to `ExampleGroup` - mark many methods as protected so they don't appear in docs
This PR introduces the following hooks to spec:
before_each
after_each
before_all
after_all
around_each
around_all
Example
Output
Remaining things:
example
that you callrun
on in aaround_each
is a simple proxy. In RSpec it has access to the real Example that will be run, we could probably do the same.around_all
(which seems to be kind of broken in RSpec, but here it works fine).And of course we need to determine if we really want all these features and they wouldn't make spec needlessly more complex.