From eaef22686ffe4aa5310a6ec51af3e5122981dbca Mon Sep 17 00:00:00 2001 From: James Truher Date: Tue, 13 Sep 2016 12:21:01 -0700 Subject: [PATCH] Add a test for get-runspace -name and remove the runspace close from AfterAll block --- .../Microsoft.PowerShell.Utility/RunspaceCmdlets.Tests.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/RunspaceCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/RunspaceCmdlets.Tests.ps1 index 815ab62a30..5f5a0feff2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/RunspaceCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/RunspaceCmdlets.Tests.ps1 @@ -12,6 +12,10 @@ Describe "Get-Runspace cmdlet tests" -Tag "CI" { $runspace = get-runspace -instanceid $CurrentRunspace.InstanceId $runspace.InstanceId | Should be $ExpectedInstanceId } + It "Get-Runspace with runspace name should return the correct runspace" { + $runspace = get-runspace -name $currentRunspace.Name + $runspace.InstanceId | Should be $ExpectedInstanceId + } It "Get-Runspace with runspace Id should return the correct runspace" { $runspace = get-runspace -id $CurrentRunspace.Id $runspace.InstanceId | Should be $ExpectedInstanceId @@ -24,7 +28,6 @@ Describe "Get-Runspace cmdlet tests" -Tag "CI" { $r2 = [runspacefactory]::CreateRunspace() } AfterAll { - $r1.Close() $r1.Dispose() $r2.Dispose() }