-
-
Notifications
You must be signed in to change notification settings - Fork 472
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
Suggest to add Should-Match
to Pester v6
#2533
Comments
Should-MatchExactly
to Pester v6Should-Match
to Pester v6
Yes. This would be |
I will try to do some coding this week on this, but can't promise anything. |
In Pester v5 I really loved the simplicity of negating a statement: .. | Should -Invoke Get-Process
.. | Should -Not -Invoke Get-Process I guess the |
The v6 style is currently # invoke is not implemented yet
.. | Should-Invoke Get-Process
.. | Should-NotInvoke Get-Process Is that worse? As we're using standalone functions to overcome parameter set max limitation the alternative would be: .. | Should-Invoke Get-Process
.. | Should-Invoke -Not Get-Process
.. | Should-Invoke Get-Process -Not The parameter doesn't flow/read as well imo. |
I hear what you say, it does read easier but for splatting purposes, the separate Also for inteliSense it would be easier to use one CmdLet name instead of having to type |
Thanks for the explanation. Let's move this discussion to a separate issue (#2550) |
Checklist
Summary of the feature request
Currently the new assertions for Pester v6 does not support regular expression matching like
Should -Match
orShould -MatchExactly
in v5. Suggest adding a commandShould-Match
andShould-NotMatch
, or possibly add a parameterRegularExpression
to the commandsShould-BeLikeString
andShould-NotBeLikeString
.How should it work?
The commands
Should-Match
andShould-NotMatch
should have the same named and positional parameters as the commandShould-NotBeLikeString
.If we reuse existing commands
Should-BeLikeString
andShould-NotBeLikeString
by adding a new switch parameter.The text was updated successfully, but these errors were encountered: