Fix another Start-Process test

This test was not viable as it didn't retain the process object,
instead relying on Get-Process with the process name, which could fail
to get the correct process (since no PID was available).

Since it is pointless to test Start-Process without -PassThru, and that
test was the exact same code as the fixed first test, it was removed.
This commit is contained in:
Andrew Schwartzmeyer
2015-12-23 12:55:36 -08:00
parent af1343472d
commit b73a33e4e5
+1 -13
View File
@@ -19,18 +19,6 @@ Describe "Start-Process" {
}
It "Should process arguments without error" {
{ Start-Process ping -ArgumentList $pingParamNoStop} | Should Not Throw
$process = Get-Process -Name ping
$process.Length | Should Be 1
$process.Id | Should BeGreaterThan 1
$process.ProcessName | Should Be "ping"
Stop-Process -Id $process.Id
}
It "Should create process object when used with PassThru argument" {
$process = Start-Process ping -ArgumentList $pingParamNoStop -PassThru
$process.Length | Should Be 1
@@ -52,6 +40,7 @@ Describe "Start-Process" {
It "Should invoke correct path when used with FilePath argument" {
$process = Start-Process -FilePath $pingCommand -ArgumentList $pingParamNoStop -PassThru
$process.Length | Should Be 1
$process.Id | Should BeGreaterThan 1
$process.ProcessName | Should Be "ping"
@@ -87,7 +76,6 @@ Describe "Start-Process" {
It "Should should handle stdout redirection without error" {
$process = Start-Process ping -ArgumentList $pingParamStop -Wait -RedirectStandardOutput $tempFile
$dirEntry = dir $tempFile
$dirEntry.Length | Should BeGreaterThan 0
}