From da42c7680a386d58d7c54b85d45bcd8cd3753e3c Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Fri, 18 Sep 2015 18:32:21 -0700 Subject: [PATCH] fixed a bug in final test to verify that we can get-content in different drives. --- src/pester-tests/Test-Get-Content.Tests.ps1 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pester-tests/Test-Get-Content.Tests.ps1 b/src/pester-tests/Test-Get-Content.Tests.ps1 index bd555127a1..09346ddd80 100644 --- a/src/pester-tests/Test-Get-Content.Tests.ps1 +++ b/src/pester-tests/Test-Get-Content.Tests.ps1 @@ -87,16 +87,18 @@ Get-Content -Path $testPath -Tail 1 | Should Be $testString } + It "Should return the last lines of a file using the Last alias" { Get-Content -Path $testPath2 -Last 1 | Should Be $fifthline } It "Should be able to get content within a different drive" { - Set-Location env: + pushd env: + $expectedoutput = [Environment]::GetEnvironmentVariable("PATH"); { Get-Content PATH } | Should Not Throw - Get-Content PATH | Should Be "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + Get-Content PATH | Should Be $expectedoutput - Set-Location / + popd } }