Skip to content

Commit c7c54a7

Browse files
Fix tests
1 parent 50ea37f commit c7c54a7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/UpdatePSResourceTests/UpdatePSResourceV2.Tests.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Describe 'Test HTTP Update-PSResource for V2 Server Protocol' -tags 'CI' {
145145
$isPkgUpdated = $false
146146
foreach ($pkg in $res)
147147
{
148-
if ([System.Version]$pkg.Version -eq [System.Version]"3.0.0")
148+
if ([System.Version]$pkg.Version -eq [System.Version]"3.0.0.0")
149149
{
150150
$isPkgUpdated = $true
151151
}
@@ -174,7 +174,7 @@ Describe 'Test HTTP Update-PSResource for V2 Server Protocol' -tags 'CI' {
174174

175175
It "Update resource to explicit prerelease version using NuGet syntax" {
176176
Install-PSResource -Name $testModuleName -Version "1.0.0.0" -Repository $PSGalleryName -TrustRepository
177-
Update-PSResource -Name $testModuleName -Version "[5.2.5-alpha001]" -Prerelease -Repository $PSGalleryName -TrustRepository
177+
Update-PSResource -Name $testModuleName -Version "5.2.5-alpha001" -Prerelease -Repository $PSGalleryName -TrustRepository
178178
$res = Get-InstalledPSResource -Name $testModuleName
179179
$res | Should -Not -BeNullOrEmpty
180180
$isPkgUpdated = $false
@@ -427,6 +427,7 @@ Describe 'Test HTTP Update-PSResource for V2 Server Protocol' -tags 'CI' {
427427
Install-PSResource -Name "TestTestScript" -Version "1.0" -Repository $PSGalleryName -TrustRepository
428428
Update-PSResource -Name "TestTestScript" -Version "1.3.1.1" -AuthenticodeCheck -Repository $PSGalleryName -TrustRepository -ErrorVariable err -ErrorAction SilentlyContinue
429429
$err.Count | Should -Not -Be 0
430-
$err[0].FullyQualifiedErrorId | Should -BeExactly "InstallPackageFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.UpdatePSResource"
430+
$err[0].FullyQualifiedErrorId | Should -Contain "GetAuthenticodeSignatureError,Microsoft.PowerShell.PSResourceGet.Cmdlets.UpdatePSResource"
431+
$err[1].FullyQualifiedErrorId | Should -BeExactly "InstallPackageFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.UpdatePSResource"
431432
}
432433
}

0 commit comments

Comments
 (0)