@@ -16,37 +16,39 @@ Describe "UseCorrectCasing" {
16
16
Invoke-Formatter ' ?' | Should - Be ' ?'
17
17
}
18
18
19
- It " Corrects applications on Windows to not end in .exe" - Skip:($IsLinux -or $IsMacOS ) {
20
- Invoke-Formatter ' Cmd' | Should - Be ' cmd'
21
- Invoke-Formatter ' Cmd' | Should - Be ' cmd'
22
- Invoke-Formatter ' MORE' | Should - Be ' more'
23
- Invoke-Formatter ' WinRM' | Should - Be ' winrm'
24
- Invoke-Formatter ' CertMgr' | Should - Be ' certmgr'
19
+ It " Does not corrects applications on the PATH" - Skip:($IsLinux -or $IsMacOS ) {
20
+ Invoke-Formatter ' Cmd' | Should - Be ' Cmd'
21
+ Invoke-Formatter ' MORE' | Should - Be ' MORE'
25
22
}
26
23
27
24
It " Preserves extension of applications on Windows" - Skip:($IsLinux -or $IsMacOS ) {
28
- Invoke-Formatter ' Cmd.exe' | Should - Be ' cmd.exe'
29
- Invoke-Formatter ' MORE.com' | Should - Be ' more.com'
30
- Invoke-Formatter ' WinRM.cmd' | Should - Be ' winrm.cmd'
31
- Invoke-Formatter ' CertMgr.MSC' | Should - Be ' certmgr.msc'
25
+ Invoke-Formatter ' cmd.exe' | Should - Be ' cmd.exe'
26
+ Invoke-Formatter ' more.com' | Should - Be ' more.com'
32
27
}
33
28
34
- It " corrects case of script function" {
35
- function Invoke-DummyFunction
36
- {
37
-
29
+ It " Preserves full application path" {
30
+ if ($IsLinux -or $IsMacOS ) {
31
+ $applicationPath = ' . /bin/ls'
32
+ }
33
+ else {
34
+ $applicationPath = ' C:\Windows\System32\cmd.exe'
38
35
}
36
+ Invoke-Formatter " . $applicationPath " | Should - Be " . $applicationPath "
37
+ }
38
+
39
+ It " Corrects case of script function" {
40
+ function Invoke-DummyFunction { }
39
41
Invoke-Formatter ' invoke-dummyFunction' | Should - Be ' Invoke-DummyFunction'
40
42
}
41
43
42
- It " preserves script path" {
44
+ It " Preserves script path" {
43
45
$path = Join-Path $TestDrive " $ ( [guid ]::NewGuid()) .ps1"
44
46
New-Item - ItemType File - Path $path
45
47
$scriptDefinition = " . $path "
46
48
Invoke-Formatter $scriptDefinition | Should - Be $scriptDefinition
47
49
}
48
50
49
- It " preserves UNC script path" - Skip:($IsLinux -or $IsMacOS ) {
51
+ It " Preserves UNC script path" - Skip:($IsLinux -or $IsMacOS ) {
50
52
$uncPath = [System.IO.Path ]::Combine(" \\$ ( HOSTNAME.EXE ) \C$\" , $TestDrive , " $ ( [guid ]::NewGuid()) .ps1" )
51
53
New-Item - ItemType File - Path $uncPath
52
54
$scriptDefinition = " . $uncPath "
0 commit comments