Skip to content

Commit 05de5fe

Browse files
author
kborle
committed
added test cases for psdrive and wildcard bug fixes
1 parent c75bfc2 commit 05de5fe

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Tests/Engine/InvokeScriptAnalyzer.tests.ps1

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,24 @@ Describe "Test Path" {
7070
}
7171
}
7272

73+
Context "When given a glob" {
74+
It "Invokes on all the matching files" {
75+
$numFilesResult = (Invoke-ScriptAnalyzer -Path $directory\R*.ps1 | Select-Object -Property ScriptName -Unique).Count
76+
$numFilesExpected = Get-ChildItem -Path $directory\R*.ps1
77+
#numFilesResult -eq $numFilesExpected | Should Be $true
78+
}
79+
}
80+
81+
Context "When given a FileSystem PSDrive" {
82+
It "Recognizes the path" {
83+
$freeDrive = 69..90 | %{([char]$_)+":"} | ?{!(Test-Path $_)} | Select-Object -First 1
84+
New-PSDrive -Name $freeDrive[0] -PSProvider FileSystem -Root $directory
85+
$numFilesExpected = (Get-ChildItem -Path $freeDrive\*.ps1).Count
86+
$numFilesResult = (Invoke-ScriptAnalyzer -Path $freeDrive\R*.ps1 | Select-Object -Property ScriptName -Unique).Count
87+
#numFilesResult -eq $numFilesExpected | Should Be $true
88+
}
89+
}
90+
7391
Context "When given a directory" {
7492
$withoutPathWithDirectory = Invoke-ScriptAnalyzer -Recurse $directory\RecursionDirectoryTest
7593
$withPathWithDirectory = Invoke-ScriptAnalyzer -Recurse -Path $directory\RecursionDirectoryTest

0 commit comments

Comments
 (0)