forked from pester/Pester
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'FilterPesterOutput' of https://github.com/nohwnd/Pester …
…into nohwnd-FilterPesterOutput
- Loading branch information
Showing
3 changed files
with
133 additions
and
26 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,57 @@ | ||
InModuleScope -ModuleName Pester -ScriptBlock { | ||
Describe 'Has-Flag' -Fixture { | ||
It 'Returns true when setting and value are the same' { | ||
$setting = [Pester.OutputTypes]::Passed | ||
$value = [Pester.OutputTypes]::Passed | ||
|
||
$value | Has-Flag $setting | Should Be $true | ||
} | ||
|
||
It 'Returns false when setting and value are the different' { | ||
$setting = [Pester.OutputTypes]::Passed | ||
$value = [Pester.OutputTypes]::Failed | ||
|
||
$value | Has-Flag $setting | Should Be $false | ||
} | ||
|
||
It 'Returns true when setting contains value' { | ||
$setting = [Pester.OutputTypes]::Passed -bor [Pester.OutputTypes]::Failed | ||
$value = [Pester.OutputTypes]::Passed | ||
|
||
$value | Has-Flag $setting | Should Be $true | ||
} | ||
|
||
It 'Returns false when setting does not contain the value' { | ||
$setting = [Pester.OutputTypes]::Passed -bor [Pester.OutputTypes]::Failed | ||
$value = [Pester.OutputTypes]::Summary | ||
|
||
$value | Has-Flag $setting | Should Be $false | ||
} | ||
|
||
It 'Returns true when at least one setting is contained in value' { | ||
$setting = [Pester.OutputTypes]::Passed -bor [Pester.OutputTypes]::Failed | ||
$value = [Pester.OutputTypes]::Summary -bor [Pester.OutputTypes]::Failed | ||
|
||
$value | Has-Flag $setting | Should Be $true | ||
} | ||
|
||
It 'Returns false when none of settings is contained in value' { | ||
$setting = [Pester.OutputTypes]::Passed -bor [Pester.OutputTypes]::Failed | ||
$value = [Pester.OutputTypes]::Summary -bor [Pester.OutputTypes]::Describe | ||
|
||
$value | Has-Flag $setting | Should Be $false | ||
} | ||
} | ||
|
||
Describe 'Default OutputTypes' -Fixture { | ||
It 'Fails output type contains all except passed' { | ||
$expected = [Pester.OutputTypes]'Default, Failed, Pending, Skipped, Inconclusive, Describe, Context, Summary' | ||
[Pester.OutputTypes]::Fails | Should Be $expected | ||
} | ||
|
||
It 'All output type contains all flags' { | ||
$expected = [Pester.OutputTypes]'Default, Passed, Failed, Pending, Skipped, Inconclusive, Describe, Context, Summary' | ||
[Pester.OutputTypes]::All | Should Be $expected | ||
} | ||
} | ||
} |
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