-
-
Notifications
You must be signed in to change notification settings - Fork 475
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #174 from dlwyatt/DescribeFix
Describe and Context fix
- Loading branch information
Showing
4 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Set-StrictMode -Version Latest | ||
|
||
Describe 'Testing Context' { | ||
It 'Has a non-mandatory fixture parameter which throws the proper error message if missing' { | ||
$command = Get-Command Context -Module Pester | ||
$command | Should Not Be $null | ||
|
||
$parameter = $command.Parameters['Fixture'] | ||
$parameter | Should Not Be $null | ||
|
||
$attribute = $parameter.Attributes | Where-Object { $_.TypeId -eq [System.Management.Automation.ParameterAttribute] } | ||
$isMandatory = $null -ne $attribute -and $attribute.Mandatory | ||
|
||
$isMandatory | Should Be $false | ||
|
||
{ Context Bogus } | Should Throw 'No test script block is provided' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Set-StrictMode -Version Latest | ||
|
||
Describe 'Testing Describe' { | ||
It 'Has a non-mandatory fixture parameter which throws the proper error message if missing' { | ||
$command = Get-Command Describe -Module Pester | ||
$command | Should Not Be $null | ||
|
||
$parameter = $command.Parameters['Fixture'] | ||
$parameter | Should Not Be $null | ||
|
||
$attribute = $parameter.Attributes | Where-Object { $_.TypeId -eq [System.Management.Automation.ParameterAttribute] } | ||
$isMandatory = $null -ne $attribute -and $attribute.Mandatory | ||
|
||
$isMandatory | Should Be $false | ||
|
||
{ Describe Bogus } | Should Throw 'No test script block is provided' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters