-
-
Notifications
You must be signed in to change notification settings - Fork 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
Respect verify partial doubles config when verifying job/mailer arguments #2808
Respect verify partial doubles config when verifying job/mailer arguments #2808
Conversation
cf5f3f8
to
67a538f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than creating a new helper, I would rather the specs be setup with an around block that restores the original behaviour, and explicitly setting the values to true
/false
in a before
in the context
, I don't mind if you make a helper for the "restore" part (in an around hook) but I would strongly prefer it if the contexts set the correct values directly in a before.
👍 Updated to match the requested style FWIW I find a block-based helper superior when temporarily mutating global state because that interface guarantees the state is reset (like Timecop safe mode for example). I've worked in many codebases which mutate global state in |
An around hook is essentially a block based helper, the problem I had with it is the implementation obscured the actual config setting that was being set, as our specs act as part of our documentation its less obvious whats being tweaked, an alternative would be to use the |
Very true.
I do use this in the other specs - but it sets a distinct flag Overall I think the PR is fine now; I'm happy to adopt the house style and appreciate the trade-offs you mention between obscuring the config setting vs safety. |
Thank you for this! |
Released in 7.1.0 |
Following on from #2745, this PR skips the job/mailer verification that arguments match the signature when:
verify_partial_doubles
false#without_partial_double_verification
This direction was suggested by @JonRowe here:
Closes #2801.