@@ -16,37 +16,39 @@ Describe "UseCorrectCasing" {
1616 Invoke-Formatter ' ?' | Should - Be ' ?'
1717 }
1818
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'
2522 }
2623
2724 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'
3227 }
3328
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'
3835 }
36+ Invoke-Formatter " . $applicationPath " | Should - Be " . $applicationPath "
37+ }
38+
39+ It " Corrects case of script function" {
40+ function Invoke-DummyFunction { }
3941 Invoke-Formatter ' invoke-dummyFunction' | Should - Be ' Invoke-DummyFunction'
4042 }
4143
42- It " preserves script path" {
44+ It " Preserves script path" {
4345 $path = Join-Path $TestDrive " $ ( [guid ]::NewGuid()) .ps1"
4446 New-Item - ItemType File - Path $path
4547 $scriptDefinition = " . $path "
4648 Invoke-Formatter $scriptDefinition | Should - Be $scriptDefinition
4749 }
4850
49- It " preserves UNC script path" - Skip:($IsLinux -or $IsMacOS ) {
51+ It " Preserves UNC script path" - Skip:($IsLinux -or $IsMacOS ) {
5052 $uncPath = [System.IO.Path ]::Combine(" \\$ ( HOSTNAME.EXE ) \C$\" , $TestDrive , " $ ( [guid ]::NewGuid()) .ps1" )
5153 New-Item - ItemType File - Path $uncPath
5254 $scriptDefinition = " . $uncPath "
0 commit comments