Skip to content

Commit 7915b68

Browse files
committed
Update container registry tests
1 parent 274c3e9 commit 7915b68

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎test/PublishPSResourceTests/PublishPSResourceContainerRegistryServer.Tests.ps1‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -522,19 +522,15 @@ Describe "Test Publish-PSResource" -tags 'CI' {
522522
$modulePrefix = "unlisted"
523523
New-ModuleManifest -Path (Join-Path -Path $script:PublishModuleBase -ChildPath "$script:PublishModuleName.psd1") -ModuleVersion $version -Description "$script:PublishModuleName module"
524524

525-
Publish-PSResource -Path $script:PublishModuleBase -Repository $script:PSGalleryName -ModulePrefix $modulePrefix -ErrorVariable err -ErrorAction SilentlyContinue
526-
$err.Count | Should -Not -Be 0
527-
$err[0].FullyQualifiedErrorId | Should -BeExactly "ModulePrefixParameterIncorrectlyProvided,Microsoft.PowerShell.PSResourceGet.Cmdlets.PublishPSResource"
525+
{ Publish-PSResource -Path $script:PublishModuleBase -Repository $script:PSGalleryName -ModulePrefix $modulePrefix -ErrorVariable err -ErrorAction SilentlyContinue -ErrorAction Stop } | Should -Throw "ModulePrefixParameterIncorrectlyProvided,Microsoft.PowerShell.PSResourceGet.Cmdlets.PublishPSResource"
528526
}
529527

530528
It "not Publish a resource when ModulePrefix is provided without Repository parameter" {
531529
$version = "1.0.0"
532530
$modulePrefix = "unlisted"
533531
New-ModuleManifest -Path (Join-Path -Path $script:PublishModuleBase -ChildPath "$script:PublishModuleName.psd1") -ModuleVersion $version -Description "$script:PublishModuleName module"
534532

535-
Publish-PSResource -Path $script:PublishModuleBase -ModulePrefix $modulePrefix -ErrorVariable err -ErrorAction SilentlyContinue
536-
$err.Count | Should -Not -Be 0
537-
$err[0].FullyQualifiedErrorId | Should -BeExactly "ModulePrefixParameterProvidedWithoutRepositoryParameter,Microsoft.PowerShell.PSResourceGet.Cmdlets.PublishPSResource"
533+
{ Publish-PSResource -Path $script:PublishModuleBase -ModulePrefix $modulePrefix -ErrorVariable err -ErrorAction SilentlyContinue -ErrorAction Stop } | Should -Throw "ModulePrefixParameterProvidedWithoutRepositoryParameter,Microsoft.PowerShell.PSResourceGet.Cmdlets.PublishPSResource"
538534
}
539535

540536
It "Publish a package given NupkgPath to a package with .psd1" {

0 commit comments

Comments
 (0)