mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-15 06:09:09 +00:00
31 lines
622 B
PowerShell
31 lines
622 B
PowerShell
# Copyright (c) Microsoft Corporation.
|
|
# Licensed under the MIT License.
|
|
Describe "Pop-Location" -Tags "CI" {
|
|
$startDirectory = $(Get-Location).Path
|
|
|
|
BeforeEach { Set-Location $startDirectory }
|
|
|
|
It "Should be able to be called without error" {
|
|
{ Pop-Location } | Should -Not -Throw
|
|
}
|
|
|
|
It "Should not take a parameter" {
|
|
{ Pop-Location .. } | Should -Throw
|
|
}
|
|
|
|
It "Should be able pop multiple times" {
|
|
Push-Location ..
|
|
Push-Location ..
|
|
Push-Location ..
|
|
|
|
Pop-Location
|
|
Pop-Location
|
|
Pop-Location
|
|
|
|
$(Get-Location).Path | Should -Be $startDirectory
|
|
|
|
}
|
|
|
|
Set-Location $startDirectory
|
|
}
|