forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResolve-Path.Tests.ps1
More file actions
26 lines (26 loc) · 1.04 KB
/
Copy pathResolve-Path.Tests.ps1
File metadata and controls
26 lines (26 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Describe "Resolve-Path returns proper path" -Tag "CI" {
It "Resolve-Path returns resolved paths" {
Resolve-Path $TESTDRIVE | Should be "$TESTDRIVE"
}
It "Resolve-Path handles provider qualified paths" {
$result = Resolve-Path Filesystem::$TESTDRIVE
$result.providerpath | should be "$TESTDRIVE"
}
It "Resolve-Path provides proper error on invalid location" {
try {
Resolve-Path $TESTDRIVE/this.directory.is.invalid -ea stop
throw "execution OK"
}
catch {
$_.fullyqualifiederrorid | should be "PathNotFound,Microsoft.PowerShell.Commands.ResolvePathCommand"
}
}
It "Resolve-Path -Path should return correct drive path" {
$result = Resolve-Path -Path "TestDrive:\\\\\"
($result.Path.TrimEnd('/\')) | Should Be "TestDrive:"
}
It "Resolve-Path -LiteralPath should return correct drive path" {
$result = Resolve-Path -LiteralPath "TestDrive:\\\\\"
($result.Path.TrimEnd('/\')) | Should Be "TestDrive:"
}
}