2016-03-04 22:48:30 +00:00
|
|
|
Describe "Pop-Location" {
|
|
|
|
$startDirectory = $(Get-Location).Path
|
|
|
|
|
|
|
|
BeforeEach { Set-Location $startDirectory }
|
|
|
|
|
|
|
|
It "Should be able to be called without error" {
|
2016-03-04 22:52:27 +00:00
|
|
|
{ Pop-Location } | Should Not Throw
|
2016-03-04 22:48:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
It "Should not take a parameter" {
|
2016-03-04 22:52:27 +00:00
|
|
|
{ Pop-Location .. } | Should Throw
|
2016-03-04 22:48:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
It "Should be able pop multiple times" {
|
2016-03-04 22:52:27 +00:00
|
|
|
Push-Location ..
|
|
|
|
Push-Location ..
|
|
|
|
Push-Location ..
|
2016-03-04 22:48:30 +00:00
|
|
|
|
2016-03-04 22:52:27 +00:00
|
|
|
Pop-Location
|
|
|
|
Pop-Location
|
|
|
|
Pop-Location
|
2016-03-04 22:48:30 +00:00
|
|
|
|
2016-03-04 22:52:27 +00:00
|
|
|
$(Get-Location).Path | Should Be $startDirectory
|
2016-03-04 22:48:30 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Set-Location $startDirectory
|
2015-10-27 18:20:35 +00:00
|
|
|
}
|