Skip to content

Commit

Permalink
Fix provider invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanbergstrom committed Jan 29, 2024
1 parent 235124a commit c0dc6cf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/AnyPackage.Homebrew.Unit.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ param()

BeforeAll {
$AnyPackageProvider = 'AnyPackage.Homebrew'
$providerShortName = $AnyPackageProvider.Split('.')[1]
Import-Module $AnyPackageProvider -Force
}

Expand Down Expand Up @@ -144,10 +145,10 @@ Describe "multi-source support" {
}

It 'refuses to register a source with no location' {
Register-PackageSource -Name $altSourceName -Provider $AnyPackageProvider -ErrorAction SilentlyContinue | Where-Object {$_.Name -eq $altSourceName} | Should -BeNullOrEmpty
Register-PackageSource -Name $altSourceName -Provider $providerShortName -ErrorAction SilentlyContinue | Where-Object {$_.Name -eq $altSourceName} | Should -BeNullOrEmpty
}
It 'registers an alternative package source' {
Register-PackageSource -Name $altSourceName -Location $altSourceLocation -Provider $AnyPackageProvider | Where-Object {$_.Name -eq $altSourceName} | Should -Not -BeNullOrEmpty
Register-PackageSource -Name $altSourceName -Location $altSourceLocation -Provider $providerShortName | Where-Object {$_.Name -eq $altSourceName} | Should -Not -BeNullOrEmpty
}
It 'searches for and installs the latest version of a package from an alternate source' {
Find-Package -Name $package -Source $altSourceName | Install-Package -PassThru | Where-Object {$_.Name -contains $package} | Should -Not -BeNullOrEmpty
Expand Down

0 comments on commit c0dc6cf

Please sign in to comment.