mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Fix Pester tests
The `Get-Process` cmdlet cannot be used for these types of tests due to security constraints on OS X. These tests are about to be re-written soon anyway, so the simple fix was to use another cmdlet.
This commit is contained in:
1 parent
86d7d749bb
commit
53bfc80b56
9 files changed
+73
-117
No files matched your search
@@ -1,35 +1,25 @@
|
||||
Describe "Format-Custom" {
|
||||
|
||||
Context "Check Format-Custom can be called validly." {
|
||||
It "Should be able to be called without error" {
|
||||
{ Get-FormatData | Format-Custom } | Should Not Throw
|
||||
}
|
||||
|
||||
It "Should be able to call the fc alias without error" {
|
||||
{ Get-FormatData | fc } | Should Not Throw
|
||||
}
|
||||
}
|
||||
|
||||
Context "Check Format-Custom aliases" {
|
||||
|
||||
It "Should have the same output between the alias and the unaliased function" {
|
||||
$nonaliased = Get-FormatData | Format-Custom
|
||||
$aliased = Get-FormatData | fc
|
||||
$($nonaliased | Out-String).CompareTo($($aliased | Out-String)) | Should Be 0
|
||||
}
|
||||
It "Should have the same output between the alias and the unaliased function" {
|
||||
$nonaliased = Get-FormatData | Format-Custom
|
||||
$aliased = Get-FormatData | fc
|
||||
$($nonaliased | Out-String).CompareTo($($aliased | Out-String)) | Should Be 0
|
||||
}
|
||||
}
|
||||
|
||||
Context "Check specific flags on Format-Custom" {
|
||||
|
||||
It "Should be able to specify the depth in output" {
|
||||
$getprocesspester = Get-FormatData | Format-Custom -depth 1
|
||||
($getprocesspester).Count | Should BeGreaterThan 0
|
||||
}
|
||||
It "Should be able to specify the depth in output" {
|
||||
$getprocesspester = Get-FormatData | Format-Custom -depth 1
|
||||
($getprocesspester).Count | Should BeGreaterThan 0
|
||||
}
|
||||
|
||||
It "Should be able to use the Property flag to select properties" {
|
||||
$ProcessName = Get-Process | Format-Custom -Property "Name"
|
||||
$ProcessName | Should Not Match "Handle"
|
||||
}
|
||||
It "Should be able to use the Property flag to select properties" {
|
||||
$CommandName = Get-Command | Format-Custom -Property "Name"
|
||||
$CommandName | Should Not Match "Source"
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user