Skip to content

Commit 2c3cbd5

Browse files
Test fixes
1 parent c7c54a7 commit 2c3cbd5

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

test/FindPSResourceTests/FindPSResourceRepositorySearching.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Describe 'Test Find-PSResource for searching and looping through repositories' -
1919
$tag2 = "Tag-Required-Script1-2.5"
2020

2121
$cmdName = "Get-TargetResource"
22-
$dscName = "SystemLocale"
22+
$dscName = "SystemLocaleDsc"
2323
$tagsEscaped = @("'$tag1'", "'PSCommand_$cmdName'", "'PSDscResource_$dscName'")
2424

2525
$cmdName2 = "Get-MyCommand"

test/SavePSResourceTests/SavePSResourceV2.Tests.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Describe 'Test HTTP Save-PSResource for V2 Server Protocol' -tags 'CI' {
174174
}
175175

176176
It "Save script without using -IncludeXML" {
177-
Save-PSResource -Name $testScriptName -Repository $PSGalleryName -Path $SaveDir -TrustRepository | Should -Not -Throw
177+
{ Save-PSResource -Name $testScriptName -Repository $PSGalleryName -Path $SaveDir -TrustRepository } | Should -Not -Throw
178178

179179
$SavedScriptFile = Join-Path -Path $SaveDir -ChildPath "$testScriptName.ps1"
180180
Test-Path -Path $SavedScriptFile -PathType 'Leaf' | Should -BeTrue
@@ -197,12 +197,13 @@ Describe 'Test HTTP Save-PSResource for V2 Server Protocol' -tags 'CI' {
197197
It "Save module that is not authenticode signed" -Skip:(!(Get-IsWindows)) {
198198
Save-PSResource -Name $testModuleName -Version "5.0.0" -AuthenticodeCheck -Repository $PSGalleryName -TrustRepository -Path $SaveDir -ErrorVariable err -ErrorAction SilentlyContinue
199199
$err.Count | Should -BeGreaterThan 0
200-
$err[0].FullyQualifiedErrorId | Should -BeExactly "InstallPackageFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource"
200+
$err[0].FullyQualifiedErrorId | Should -Contain "GetAuthenticodeSignatureError,Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource"
201+
$err[1].FullyQualifiedErrorId | Should -Contain "InstallPackageFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource"
201202
}
202203

203204
# Save resource that requires license
204205
It "Save resource that requires accept license with -AcceptLicense flag" {
205-
Save-PSResource -Repository $TestGalleryName -TrustRepository -Path $SaveDir `
206+
Save-PSResource -Repository $PSGalleryName -TrustRepository -Path $SaveDir `
206207
-Name $testModuleName2 -AcceptLicense
207208
$pkg = Get-InstalledPSResource -Path $SaveDir -Name $testModuleName2
208209
$pkg.Name | Should -Be $testModuleName2

0 commit comments

Comments
 (0)