Skip to content

Commit 1ce8b35

Browse files
authored
Fix tests in Exampls folder to all pass. (PowerShell#434)
Three of them started to fail when I added another psd1 file to the folder (for the PSSA settings).
1 parent b8b8b0b commit 1ce8b35

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

examples/Tests/PathProcessing.Tests.ps1

+12-3
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,16 @@ Describe 'Verify Path Processing for Wildcards Allowed Impl' {
6565
Should Be @("$WorkspaceRoot\README.md", "$WorkspaceRoot\PathProcessingWildcards.ps1")
6666
}
6767
It 'Processes wildcard absolute path via -Path param' {
68-
Import-FileWildcard -Path $WorkspaceRoot\*.psd1 | Should Be "$WorkspaceRoot\SampleModule.psd1"
68+
$files = Import-FileWildcard -Path $WorkspaceRoot\*.psd1
69+
$files.Count | Should Be 2
70+
$files[0] | Should Be "$WorkspaceRoot\PSScriptAnalyzerSettings.psd1"
71+
$files[1] | Should Be "$WorkspaceRoot\SampleModule.psd1"
6972
}
7073
It 'Processes wildcard relative path via -Path param' {
71-
Import-FileWildcard -Path *.psd1 | Should Be "$WorkspaceRoot\SampleModule.psd1"
74+
$files = Import-FileWildcard -Path *.psd1
75+
$files.Count | Should Be 2
76+
$files[0] | Should Be "$WorkspaceRoot\PSScriptAnalyzerSettings.psd1"
77+
$files[1] | Should Be "$WorkspaceRoot\SampleModule.psd1"
7278
}
7379
It 'Processes relative path via -Path param' {
7480
Import-FileWildcard -Path ..\examples\README.md | Should Be "$WorkspaceRoot\README.md"
@@ -79,7 +85,10 @@ Describe 'Verify Path Processing for Wildcards Allowed Impl' {
7985
}
8086

8187
It 'DefaultParameterSet should be Path' {
82-
Import-FileWildcard *.psd1 | Should Be "$WorkspaceRoot\SampleModule.psd1"
88+
$files = Import-FileWildcard *.psd1
89+
$files.Count | Should Be 2
90+
$files[0] | Should Be "$WorkspaceRoot\PSScriptAnalyzerSettings.psd1"
91+
$files[1] | Should Be "$WorkspaceRoot\SampleModule.psd1"
8392
}
8493

8594
It 'Should process absolute literal paths via -LiteralPath param'{

0 commit comments

Comments
 (0)