Files
PowerShell/test/powershell/Pop-Location.Tests.ps1
T

28 lines
534 B
PowerShell
Raw Normal View History

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