-
Notifications
You must be signed in to change notification settings - Fork 0
Home
The biz.dch.PS.Pester.Assertions
PowerShell module is an add-on to Pester
and defines custom assertions you can use in your regular Pester scripts.
For a brief description on how to create custom assertions have a look at Extending Pester for fun and profit.
You can install this module as any other regular PowerShell module. Pester
will automatically load and detect the module, so you can use the assertions as described in the examples and wiki. Have a look at the tests as well to see the assertions in action.
As we at d-fens use this module along with our other PowerShell modules it has some dependencies, such as:
You can easily modify and remove the dependencies if you prefer to have a stand-alone version.
Currently the Pester Not
operator will NOT work with the ThrowException
assertion as the logic in Pester does not seem to handle a not aoccurring exception and the Pester defined message templates cannot handle that.
Have a look at the test ThrowExceptionWithoutExceptionShouldSucceedButActuallyFails
to see such a scenario.
d-fens GmbH, General-Guisan-Strasse 6, CH-6300 Zug, Switzerland, http://d-fens.ch