PowerShell/test/powershell/Format-Custom.Tests.ps1
Andrew Schwartzmeyer 53bfc80b56 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.
2016-04-25 15:27:24 -07:00

26 lines
886 B
PowerShell

Describe "Format-Custom" {
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
}
}
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 use the Property flag to select properties" {
$CommandName = Get-Command | Format-Custom -Property "Name"
$CommandName | Should Not Match "Source"
}
}
}