Skip to content

Commit

Permalink
Shrug?
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanbergstrom committed Jan 29, 2024
1 parent 1f600f1 commit 9975d78
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/AnyPackage.Homebrew.Unit.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ Describe 'DSC-compliant package installation and uninstallation' {
Find-Package -Name $package -Source $source | Where-Object {$_.Name -contains $package} | Should -Not -BeNullOrEmpty
}
It 'silently installs the latest version of a package' {
{Install-Package -Name $package -Source $source} | Should -Not -Throw
Install-Package -Name $package -Source $source -PassThru | Where-Object {$_.Name -contains $package} | Should -Not -BeNullOrEmpty
}
It 'finds the locally installed package just installed' {
Get-Package -Name $package | Where-Object {$_.Name -contains $package} | Should -Not -BeNullOrEmpty
}
It 'silently uninstalls the locally installed package just installed' {
{Uninstall-Package -Name $package} | Should -Not -Throw
Uninstall-Package -Name $package -PassThru | Where-Object {$_.Name -contains $package} | Should -Not -BeNullOrEmpty
}
}
Context 'cask' {
Expand All @@ -55,13 +55,13 @@ Describe 'DSC-compliant package installation and uninstallation' {
Find-Package -Name $package | Where-Object {$_.Name -contains $package} | Should -Not -BeNullOrEmpty
}
It 'silently installs the latest version of a package' {
{Install-Package -Name $package} | Should -Not -Throw
Install-Package -Name $package -PassThru | Where-Object {$_.Name -contains $package} | Should -Not -BeNullOrEmpty
}
It 'finds the locally installed package just installed' {
Get-Package -Name $package | Where-Object {$_.Name -contains $package} | Should -Not -BeNullOrEmpty
}
It 'silently uninstalls the locally installed package just installed' {
{Uninstall-Package -Name $package} | Should -Not -Throw
Uninstall-Package -Name $package -PassThru | Where-Object {$_.Name -contains $package} | Should -Not -BeNullOrEmpty
}
}
}
Expand All @@ -74,10 +74,10 @@ Describe 'pipeline-based package installation and uninstallation' {
}

It 'searches for and silently installs the latest version of a package' {
{Find-Package -Name $package -Source $source | Install-Package} | Should -Not -Throw
Find-Package -Name $package -Source $source | Install-Package -PassThru | Where-Object {$_.Name -contains $package} | Should -Not -BeNullOrEmpty
}
It 'finds and silently uninstalls the locally installed package just installed' {
{Get-Package -Name $package | Uninstall-Package} | Should -Not -Throw
Get-Package -Name $package | Uninstall-Package -PassThru | Where-Object {$_.Name -contains $package} | Should -Not -BeNullOrEmpty
}
}
Context 'cask' {
Expand All @@ -86,10 +86,10 @@ Describe 'pipeline-based package installation and uninstallation' {
}

It 'searches for and silently installs the latest version of a package' {
{Find-Package -Name $package | Install-Package} | Should -Not -Throw
Find-Package -Name $package | Install-Package -PassThru | Where-Object {$_.Name -contains $package} | Should -Not -BeNullOrEmpty
}
It 'finds and silently uninstalls the locally installed package just installed' {
{Get-Package -Name $package | Uninstall-Package} | Should -Not -Throw
Get-Package -Name $package | Uninstall-Package -PassThru | Where-Object {$_.Name -contains $package} | Should -Not -BeNullOrEmpty
}
}
}
Expand Down Expand Up @@ -150,7 +150,7 @@ Describe "multi-source support" {
Register-PackageSource -Name $altSourceName -Location $altSourceLocation -Provider $AnyPackageProvider | 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 | Where-Object {$_.Name -contains $package} | Should -Not -BeNullOrEmpty
Find-Package -Name $package -Source $altSourceName | Install-Package -PassThru | Where-Object {$_.Name -contains $package} | Should -Not -BeNullOrEmpty
}
It 'unregisters an alternative package source' {
Unregister-PackageSource -Name $altSourceName -Provider $AnyPackageProvider
Expand Down

0 comments on commit 9975d78

Please sign in to comment.