8000 Fix formatting in Convert-Path.Tests.ps1. (#6595) · PowerShell/PowerShell@9d3c263 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9d3c263

Browse files
sethvsiSazonov
authored andcommitted
Fix formatting in Convert-Path.Tests.ps1. (#6595)
1 parent 1f7b3a6 commit 9d3c263

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

test/powershell/Modules/Microsoft.PowerShell.Management/Convert-Path.Tests.ps1

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,43 @@
22
# Licensed under the MIT License.
33
Describe "Convert-Path tests" -Tag CI {
44
It "Convert-Path should handle provider qualified paths" {
5-
Convert-Path "FileSystem::${TESTDRIVE}" | Should -BeExactly "${TESTDRIVE}"
5+
Convert-Path -Path "FileSystem::${TestDrive}" | Should -BeExactly "${TestDrive}"
66
}
7+
78
It "Convert-Path should return the proper path" {
8-
Convert-Path "$TESTDRIVE" | Should -BeExactly "$TESTDRIVE"
9+
Convert-Path -Path "$TestDrive" | Should -BeExactly "$TestDrive"
910
}
11+
1012
It "Convert-Path supports pipelined input" {
11-
"$TESTDRIVE" | Convert-Path | Should -BeExactly "$TESTDRIVE"
13+
"$TestDrive" | Convert-Path | Should -BeExactly "$TestDrive"
1214
}
15+
1316
It "Convert-Path supports pipelined input by property name" {
14-
get-item $TESTDRIVE | Convert-Path | Should -BeExactly "$TESTDRIVE"
17+
Get-Item -Path $TestDrive | Convert-Path | Should -BeExactly "$TestDrive"
1518
}
19+
1620
It "Convert-Path without arguments is an error" {
1721
$ps = [powershell]::Create()
1822
{ $ps.AddCommand("Convert-Path").Invoke() } | Should -Throw -ErrorId "ParameterBindingException"
1923
}
24+
2025
It "Convert-Path with null path is an error" {
21-
{ Convert-Path -path "" } | Should -Throw -ErrorId "ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.ConvertPathCommand"
26+
{ Convert-Path -Path "" } | Should -Throw -ErrorId "ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.ConvertPathCommand"
2227
}
28+
2329
It "Convert-Path with non-existing non-filesystem path is an error" {
24-
{ Convert-Path -path "env:thisvariableshouldnotexist" -ErrorAction Stop } | Should -Throw -ErrorId "PathNotFound,Microsoft.PowerShell.Commands.ConvertPathCommand"
30+
{ Convert-Path -Path "env:thisvariableshouldnotexist" -ErrorAction Stop } | Should -Throw -ErrorId "PathNotFound,Microsoft.PowerShell.Commands.ConvertPathCommand"
2531
}
32+
2633
It "Convert-Path can handle multiple directories" {
27-
$d1 = Setup -D dir1 -pass
28-
$d2 = Setup -D dir2 -pass
29-
$result = convert-path "${TESTDRIVE}/dir?"
34+
$d1 = Setup -Dir -Path dir1 -PassThru
35+
$d2 = Setup -Dir -Path dir2 -PassThru
36+
$result = Convert-Path -Path "${TestDrive}/dir?"
3037
$result.count | Should -Be 2
3138
$result -join "," | Should -BeExactly (@("$d1","$d2") -join ",")
3239
}
40+
3341
It "Convert-Path should return something which exists" {
34-
Convert-Path $TESTDRIVE | Should -Exist
42+
Convert-Path -Path $TestDrive | Should -Exist
3543
}
3644
}

0 commit comments

Comments
 (0)
0