Skip to content

Commit 5e6b639

Browse files
committed
fix Get-PackagePathInfo tests for drive-relative paths
1 parent 5609f5c commit 5e6b639

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

tests/Get-PackagePathInfo.Tests.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,16 @@ Describe 'Get-PackagePathInfo' {
4141
$info.AbsoluteLocation | Should -BeExactly (Join-Path -Path $PWD -ChildPath 'README.md')
4242
}
4343
It "Local directory by drive-relative path" {
44-
$info = Get-PackagePathInfo -BasePath $PWD -Path '\Windows'
44+
Push-Location -LiteralPath $env:SystemRoot
45+
$info = Get-PackagePathInfo -BasePath $PWD -Path '\Users'
46+
Pop-Location
4547

4648
$info.Valid | Should -Be $true
4749
$info.Type | Should -BeExactly 'FILE'
48-
$info.AbsoluteLocation | Should -BeExactly "$env:SystemDrive\Windows"
50+
$info.AbsoluteLocation | Should -BeExactly "$env:SystemDrive\Users"
4951
}
5052
It "Local directory by drive-relative path with ForceBasePathIfRelative" {
51-
$info = Get-PackagePathInfo -BasePath $PWD -Path '\Windows' -ForceBasePathIfRelative
53+
$info = Get-PackagePathInfo -BasePath $env:SystemRoot -Path '\Users' -ForceBasePathIfRelative
5254

5355
$info.Valid | Should -Be $false
5456
$info.ErrorMessage | Should -Not -BeNullOrEmpty

0 commit comments

Comments
 (0)