-
-
Notifications
You must be signed in to change notification settings - Fork 477
Closed
Labels
Milestone
Description
Should assertions have multiple quirks and pain points, here is a not-complete list:
-Bedoes too much, so it is hard to understand what is happening- Enumeration via pipeline complicates a lot of things and
-Behas special logic to revert this, which does not always work - It is difficult to apply seperate special behavior for different types of data (e.g.
Should -BeFalse -AllowNull -AllowTypeCast -FalseStringAsFalse,Should -BeString -CaseSensitive,Should -BeCollection -All { $_ -like "*file.ps1" }) because parameter sets limited to 32 parameter sets per function
I researched the various limitations of Should by writing a separate module Assert which has nice functionality but is not used often because people are not aware of it. I think it would be wort it to merge the functionality into Pester and fix some of the quirks finally. But I am wondering what ways forward I actually have.
There are few more limitations:
- How to export the Should-* functions without triggering Verb warning? (Pester is getting around this by using single word functions at the moment).
- How to ensure backward compatibility? (probably Should -Be has to remain in place while Should-Be is added)
- Should this change be done in v5? (if it is parallel then we can do it as non-breaking change).