Skip to content

Commit

Permalink
add exception-example for Should (pester#2171)
Browse files Browse the repository at this point in the history
  • Loading branch information
fflaten authored May 3, 2022
1 parent c79a6fa commit 8869115
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/functions/assertions/Should.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,15 @@ function Should {
.EXAMPLE
$planets.Name | Should -Be $Expected
.EXAMPLE
```powershell
Context "We want to ensure an exception is thrown when expected" {
It "Throws the exception" {
{ Get-Application -Name Blarg } | Should -Throw "Application 'Blarg' not found"
}
}
```
#>

[CmdletBinding()]
Expand Down

0 comments on commit 8869115

Please sign in to comment.