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

For rspec, clear in the around block instead of the before block #274

Merged
merged 1 commit into from
Apr 22, 2024

Conversation

DropsOfSerenity
Copy link
Contributor

@DropsOfSerenity DropsOfSerenity commented Apr 1, 2024

Due to hook order we clear on around instead of before. This is because if we clear in before, before runs after around does and therefore overrides any redis based changes we make in the around hook.

If we clear in around, we can make changes to redis in both the around and before hooks!

People may rely on the previous confusing behavior implicitly, so I recommend potentially making this a minor/major version change.

Due to hook order we clear on around instead of before. This is
because if we clear in before, before runs AFTER around does and
therefore overrides any redis based changes we make in the around
hook.

If we clear in around, we can make changes to redis in BOTH the
around and before hooks!
@guilleiguaran guilleiguaran merged commit c28f7ac into guilleiguaran:master Apr 22, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants