added additional testing according to code review
This commit is contained in:
parent
aa45feb385
commit
cec380e4b4
1 changed files with 12 additions and 4 deletions
|
@ -10,10 +10,13 @@
|
||||||
|
|
||||||
It "Should allow piping objects to it" {
|
It "Should allow piping objects to it" {
|
||||||
{ $testdirectory | Test-Path } | Should Not Throw
|
{ $testdirectory | Test-Path } | Should Not Throw
|
||||||
|
|
||||||
|
$testdirectory | Test-Path | Should Be $true
|
||||||
|
"/usr/bin/totallyFakeDirectory" | Test-Path | Should Be $false
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Should return a boolean data type" {
|
It "Should return a boolean data type" {
|
||||||
{ Test-Path -Path $testdirectory } | Should Be ($true -or $false)
|
{ Test-Path -Path $testdirectory } | Should Be $true
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Should be called on a nonexistant path without error" {
|
It "Should be called on a nonexistant path without error" {
|
||||||
|
@ -29,13 +32,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Should be able to accept a regular expression" {
|
It "Should be able to accept a regular expression" {
|
||||||
{ Test-Path -Path "/u*" } | Should Not Throw
|
{ Test-Path -Path "/u*" } | Should Not Throw
|
||||||
|
{ Test-Path -Path "/u[a-z]r" } | Should Not Throw
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Should be able to return the correct result when a regular expression is used" {
|
It "Should be able to return the correct result when a regular expression is used" {
|
||||||
Test-Path -Path "/u*" | Should Be $true
|
Test-Path -Path "/u*" | Should Be $true
|
||||||
|
Test-Path -Path "/u[a-z]*" | Should Be $true
|
||||||
|
|
||||||
Test-Path -Path "/aoeu*" | Should Be $false
|
Test-Path -Path "/aoeu*" | Should Be $false
|
||||||
|
Test-Path -Path "/u[A-Z]" | Should Be $false
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Should return false when the Leaf pathtype is used on a directory" {
|
It "Should return false when the Leaf pathtype is used on a directory" {
|
||||||
|
@ -93,10 +99,12 @@
|
||||||
|
|
||||||
It "Should return false if regular expressions are used with the LiteralPath switch" {
|
It "Should return false if regular expressions are used with the LiteralPath switch" {
|
||||||
Test-Path -LiteralPath /*sr/bin | Should Be $false
|
Test-Path -LiteralPath /*sr/bin | Should Be $false
|
||||||
|
Test-Path -LiteralPath /[usth]sr/bin | Should Be $false
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Should return false if regular expressions are used with the LiteralPath alias PSPath switch" {
|
It "Should return false if regular expressions are used with the LiteralPath alias PSPath switch" {
|
||||||
Test-Path -PSPath /*sr/bin | Should Be $false
|
Test-Path -PSPath /*sr/bin | Should Be $false
|
||||||
|
Test-Path -PSPath /[aoeu]sr/bin | Should Be $false
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Should return true if used on components other than filesystem objects" {
|
It "Should return true if used on components other than filesystem objects" {
|
||||||
|
|
Loading…
Reference in a new issue