PowerShell/test/powershell/Format-Wide.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

34 lines
1.2 KiB
PowerShell

Describe "Format-Wide" {
It "Should have the same output between the alias and the unaliased function" {
$nonaliased = Get-ChildItem | Format-Wide
$aliased = Get-ChildItem | fw
$($nonaliased | Out-String).CompareTo($($aliased | Out-String)) | Should Be 0
}
It "Should be able to specify the columns in output using the column switch" {
{ ls | Format-Wide -Column 3 } | Should Not Throw
}
It "Should be able to use the autosize switch" {
{ ls | Format-Wide -Autosize } | Should Not Throw
}
It "Should be able to take inputobject instead of pipe" {
{ Format-Wide -InputObject $(ls) } | Should Not Throw
}
It "Should be able to use the property switch" {
{ Format-Wide -InputObject $(ls) -Property Mode } | Should Not Throw
}
It "Should throw an error when property switch and view switch are used together" {
{ Format-Wide -InputObject $(ls) -Property CreationTime -View aoeu } | Should Throw "Found invalid data"
}
It "Should throw and suggest proper input when view is used with invalid input without the property switch" {
{ Format-Wide -InputObject $(gps) -View aoeu } | Should Throw
}
}