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:
Andrew Schwartzmeyer committed 2016-04-25 15:27:24 -07:00
1 parent 86d7d749bb
commit 53bfc80b56
9 files changed
+73 -117

No files matched your search

+10 -21
View File
@@ -1,14 +1,14 @@
Describe "Format-Table" {
It "Should call format table on piped input without error" {
{ Get-Process | Format-Table } | Should Not Throw
{ Get-Date | Format-Table } | Should Not Throw
{ Get-Process | ft } | Should Not Throw
{ Get-Date | ft } | Should Not Throw
}
It "Should return a format object data type" {
$val = (Get-Process | Format-Table | gm )
$val = (Get-Date | Format-Table | gm )
$val2 = (Get-Process | Format-Table | gm )
$val2 = (Get-Date | Format-Table | gm )
$val.TypeName | Should Match "Microsoft.Powershell.Commands.Internal.Format"
@@ -16,24 +16,13 @@ Describe "Format-Table" {
}
It "Should be able to be called with optional parameters" {
$v1 = (Get-Process | Format-Table *)
$v2 = (Get-Process | Format-Table -Property ProcessName)
$v3 = (Get-Process | Format-Table -GroupBy ProcessName)
$v4 = (Get-Process | Format-Table -View StartTime)
$v1 = (Get-Date | Format-Table *)
$v2 = (Get-Date | Format-Table -Property Hour)
$v3 = (Get-Date | Format-Table -GroupBy Hour)
$v12 = (Get-Process | ft *)
$v22 = (Get-Process | ft -Property ProcessName)
$v32 = (Get-Process | ft -GroupBy ProcessName)
$v42 = (Get-Process | ft -View StartTime)
$v12 = (Get-Date | ft *)
$v22 = (Get-Date | ft -Property Hour)
$v32 = (Get-Date | ft -GroupBy Hour)
{ $v1 } | Should Not Throw
{ $v2 } | Should Not Throw
{ $v3 } | Should Not Throw
{ $v4 } | Should Not Throw
{ $v12 } | Should Not Throw
{ $v22 } | Should Not Throw
{ $v32 } | Should Not Throw
{ $v42 } | Should Not Throw
}
}