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
Refactor spec hooks #9090
Merged
bcardiff
merged 3 commits into
crystal-lang:master
from
straight-shoota:refactor/spec-hooks
May 13, 2020
Merged
Refactor spec hooks #9090
bcardiff
merged 3 commits into
crystal-lang:master
from
straight-shoota:refactor/spec-hooks
May 13, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Refactor all spec hooks to work in the root context * Deprecate hook methods in Spec namespace * Improve documentation of spec hooks * Add spec for spec hooks
RX14
approved these changes
Apr 16, 2020
Sija
reviewed
Apr 16, 2020
asterite
reviewed
Apr 16, 2020
bcardiff
reviewed
Apr 16, 2020
straight-shoota
force-pushed
the
refactor/spec-hooks
branch
from
May 9, 2020 00:43
2b27e22
to
e55f108
Compare
I've removed the deprecation of We can iterate on this behaviour later. It leaves the option to implement top-level methods as file-scoped hooks. |
I don't think this is a breaking change anymore. Also it doesn't resolve #8930 because it essentially only addresses the last point. |
bcardiff
approved these changes
May 11, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactor all spec hooks to work in the root contextDeprecate hook methods in Spec namespaceNote:
around_all
does not work on the root context. Because the block is supposed to be called with aExampleGroup
. We could perhaps make it work with some effort, but I don't think that's necessary. It would not be have many use cases anyways. This wasn't possible before, so it won't be in this PR.