diff --git a/src/pester-tests/Test-Split-Path.Tests.ps1 b/src/pester-tests/Test-Split-Path.Tests.ps1 index 6d33571913..47dc536a0d 100644 --- a/src/pester-tests/Test-Split-Path.Tests.ps1 +++ b/src/pester-tests/Test-Split-Path.Tests.ps1 @@ -14,27 +14,29 @@ # ErrorAction SilentlyContinue merely suppresses the error from the console. # Throwing exceptions still seen by Pester. - Split-Path "C:\Users" -Qualifier -ErrorAction SilentlyContinue | Should Throw + Split-Path "C:\Users" -Qualifier -ErrorAction SilentlyContinue | Should Throw } It "Should error when no directory separator characters are used with a qualifier" { - Split-Path "abadTest" -Qualifier -ErrorAction SilentlyContinue | Should Throw + Split-Path "abadTest" -Qualifier -ErrorAction SilentlyContinue | Should Throw } - It "Should return the path when the noqualifier switch is used on a linux system" { + It "Should return the path when the noqualifier switch is used on a Linux system" { { Split-Path /usr/bin -NoQualifier } | Should Not Throw Split-Path /usr/bin -NoQualifier | Should Be "/usr/bin" } - It "Should return the parent folder name when the leaf switch is used" { + It "Should return the base name when the leaf switch is used" { Split-Path /usr/bin -Leaf | Should be "bin" Split-Path /usr/local/bin -Leaf | Should be "bin" Split-Path usr/bin -Leaf | Should be "bin" + Split-Path ./bin -Leaf | Should be "bin" + Split-Path bin -Leaf | Should be "bin" } It "Should be able to accept regular expression input and output an array for multiple objects" { $testDir = "./tmp" - Remove-Item $testDir -Recurse -Force + Remove-Item $testDir -Recurse -Force -ErrorAction Ignore $testFile1 = "testfile1.ps1" $testFile2 = "testfile2.ps1" @@ -51,7 +53,7 @@ $actual[0] | Should Be $testFile1 $actual[1] | Should Be $testFile2 - Remove-Item $testDir -Recurse -Force + Remove-Item $testDir -Recurse -Force -ErrorAction Ignore Test-Path $testDir | Should Be $false }