-
Notifications
You must be signed in to change notification settings - Fork 17
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
Lexical strict mode for mockmodule makes it difficult to have global strict mode. #58
Comments
I'd be fine with that. Alternatively, I could re-jig my patch to only have any effect if you |
Before providing any code, here is a suggestion. What about requesting for By default we could promote use Test::MockModule 'strict'; # global is the default mode when not specified
use Test::MockModule 'strict' => 'global'; # you can also set the global mode
# or
use Test::MockModule 'strict' => 'lexical'; # or if you prefer you can set the lexically mode Using both mode will die #
like dies {
use Test::MockModule 'strict' => 'global';
# ... then later
use Test::MockModule 'strict' => 'lexical';
}, qr{Incompatible usage of Test::MockModule strict modes 'lexical' and 'global'. Use one or the other.} @DrHyde would that work and match what you have in mind? |
@DrHyde I'm also wondering why #54 was added in the first place. It looks like that The only point of I'm balancing the pros/cons of reverting #54 or providing a more complex solution to accommodate the global/lexical mode. Thanks for providing more details. |
We wanted to lexicalize it at work so we could incrementally improve our code, using |
In #53, an issue was raised that a global strict mode was a problem for some Mojo tests. The pull request submitted in #54 got rid of global strict and replaced it with a lexical only strict mode for
Test::MockModule
.@DrHyde, We needed this global strict mode which we used in a policy to detect if people were failing to set strict mode for their import.
Looking at the pull request, I want to suggest an alternative. I would like to put back the global strict mode but honor a lexical "nostrict" mode when specified. Would this work for you @DrHyde ?
The text was updated successfully, but these errors were encountered: