Skip to content

Commit

Permalink
Merge pull request chocolatey#3374 from corbob/fix-master-tests
Browse files Browse the repository at this point in the history
(chocolatey#2712) Fixup Pester Tests on Master branch
  • Loading branch information
gep13 authored Dec 20, 2023
2 parents 73a4af4 + fadd3b2 commit 05a0deb
Show file tree
Hide file tree
Showing 79 changed files with 120 additions and 120 deletions.
2 changes: 1 addition & 1 deletion Invoke-Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ try {
$PesterConfiguration = [PesterConfiguration]@{
Run = @{
PassThru = $true
Path = "$PSScriptRoot/tests/chocolatey-tests"
Path = "$PSScriptRoot/tests/pester-tests"
}
TestResult = @{
Enabled = $true
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Describe "Ensuring Chocolatey is correctly installed" -Tag Environment, Chocolat
It "Outputs the version when run with --version" {
$Output = Invoke-Choco --version
$script:CurrentVersion = $Output.String
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
$LastExitCode | Should -Be 0
($Output.String -split '-' | Select-Object -First 1) -as [version] | Should -BeTrue
}
Expand Down Expand Up @@ -345,7 +345,7 @@ exit $error.count
}

It 'should exit Success (0)' {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It 'should <removal> shim <_> on upgrade' -ForEach $RemovedShims {
Expand All @@ -369,7 +369,7 @@ exit $error.count
}

It 'Exits with Success (0)' {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It 'Should remove the invalid configuration file' {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Describe "choco <_>" -ForEach $Command -Tag Chocolatey, ApiKeyCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Only displays chocolatey name with version" {
Expand All @@ -42,7 +42,7 @@ Describe "choco <_>" -ForEach $Command -Tag Chocolatey, ApiKeyCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Only displays chocolatey name with version" {
Expand All @@ -57,7 +57,7 @@ Describe "choco <_>" -ForEach $Command -Tag Chocolatey, ApiKeyCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Only displays chocolatey name with version" {
Expand All @@ -71,7 +71,7 @@ Describe "choco <_>" -ForEach $Command -Tag Chocolatey, ApiKeyCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Only displays chocolatey name with version" {
Expand Down Expand Up @@ -104,7 +104,7 @@ Describe "choco <_>" -ForEach $Command -Tag Chocolatey, ApiKeyCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Displays chocolatey name with version" {
Expand Down Expand Up @@ -148,7 +148,7 @@ Describe "choco <_>" -ForEach $Command -Tag Chocolatey, ApiKeyCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Displays chocolatey name with version" {
Expand Down Expand Up @@ -195,7 +195,7 @@ Describe "choco <_>" -ForEach $Command -Tag Chocolatey, ApiKeyCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Displays chocolatey name with version" {
Expand Down Expand Up @@ -243,7 +243,7 @@ Describe "choco <_>" -ForEach $Command -Tag Chocolatey, ApiKeyCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Displays chocolatey name with version" {
Expand Down Expand Up @@ -275,7 +275,7 @@ Describe "choco <_>" -ForEach $Command -Tag Chocolatey, ApiKeyCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Displays chocolatey name with version" {
Expand All @@ -299,7 +299,7 @@ Describe "choco <_>" -ForEach $Command -Tag Chocolatey, ApiKeyCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Displays chocolatey name with version" {
Expand All @@ -317,7 +317,7 @@ Describe "choco <_>" -ForEach $Command -Tag Chocolatey, ApiKeyCommand {
}

It "Exits with Failure (1)" {
$Output.ExitCode | Should -Be 1
$Output.ExitCode | Should -Be 1 -Because $Output.String
}

It "Displays chocolatey name with version" {
Expand All @@ -337,7 +337,7 @@ Describe "choco <_>" -ForEach $Command -Tag Chocolatey, ApiKeyCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Displays chocolatey name with version" {
Expand All @@ -358,7 +358,7 @@ Describe "choco <_>" -ForEach $Command -Tag Chocolatey, ApiKeyCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Displays chocolatey name with version" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Describe "choco config" -Tag Chocolatey, ConfigCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Displays chocolatey name with version" {
Expand Down Expand Up @@ -104,7 +104,7 @@ Describe "choco config" -Tag Chocolatey, ConfigCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Displays chocolatey name with version" {
Expand All @@ -122,7 +122,7 @@ Describe "choco config" -Tag Chocolatey, ConfigCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Displays chocolatey name with version" {
Expand All @@ -140,7 +140,7 @@ Describe "choco config" -Tag Chocolatey, ConfigCommand {
}

It "Exits with failure (1)" {
$Output.ExitCode | Should -Be 1
$Output.ExitCode | Should -Be 1 -Because $Output.String
}

It "Outputs an error indicating that there's no config by that name" {
Expand All @@ -157,7 +157,7 @@ Describe "choco config" -Tag Chocolatey, ConfigCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Displays chocolatey name with version" {
Expand All @@ -184,7 +184,7 @@ Describe "choco config" -Tag Chocolatey, ConfigCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Displays chocolatey name with version" {
Expand All @@ -211,7 +211,7 @@ Describe "choco config" -Tag Chocolatey, ConfigCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Displays chocolatey name with version" {
Expand Down Expand Up @@ -241,7 +241,7 @@ Describe "choco config" -Tag Chocolatey, ConfigCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Displays chocolatey name with version" {
Expand All @@ -268,7 +268,7 @@ Describe "choco config" -Tag Chocolatey, ConfigCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Displays chocolatey name with version" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Describe "choco export" -Tag Chocolatey, ExportCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Displays description of command" {
Expand Down Expand Up @@ -133,7 +133,7 @@ Describe "choco export" -Tag Chocolatey, ExportCommand {
}

It "Exits with success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

# NOTE: There is no output other than the header, and possibly the unofficial statement
Expand Down Expand Up @@ -184,7 +184,7 @@ Describe "choco export" -Tag Chocolatey, ExportCommand {
}

It "Exits with success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

# NOTE: There is no output other than the header, and possibly the unofficial statement
Expand Down Expand Up @@ -226,7 +226,7 @@ Describe "choco export" -Tag Chocolatey, ExportCommand {
}

It "Exits with success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

# NOTE: There is no output other than the header, and possibly the unofficial statement
Expand Down Expand Up @@ -277,7 +277,7 @@ Describe "choco export" -Tag Chocolatey, ExportCommand {
}

It "Exits with success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

# NOTE: There is no output other than the header, and possibly the unofficial statement
Expand Down Expand Up @@ -319,7 +319,7 @@ Describe "choco export" -Tag Chocolatey, ExportCommand {
}

It "Exits with success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

# NOTE: There is no output other than the header, and possibly the unofficial statement
Expand Down Expand Up @@ -387,7 +387,7 @@ Describe "choco export" -Tag Chocolatey, ExportCommand {
}

It "Exits with success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

# NOTE: There is no output other than the header, and possibly the unofficial statement
Expand Down Expand Up @@ -415,7 +415,7 @@ Describe "choco export" -Tag Chocolatey, ExportCommand {
}

It "Exits with Failure (1)" {
$Output.ExitCode | Should -Be 1
$Output.ExitCode | Should -Be 1 -Because $Output.String
}

It "Reports unable to export packages" {
Expand All @@ -439,7 +439,7 @@ Describe "choco export" -Tag Chocolatey, ExportCommand {
}

It "Exits with Failure (1)" {
$Output.ExitCode | Should -Be 1
$Output.ExitCode | Should -Be 1 -Because $Output.String
}

It "Reports unable to export packages" {
Expand All @@ -459,7 +459,7 @@ Describe "choco export" -Tag Chocolatey, ExportCommand {
}

It "Exits with Failure (1)" {
$Output.ExitCode | Should -Be 1
$Output.ExitCode | Should -Be 1 -Because $Output.String
}

It "Displays help page" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Describe "choco <_>" -ForEach $Command -Tag Chocolatey, FeatureCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Lists available features" {
Expand Down Expand Up @@ -124,7 +124,7 @@ Describe "choco <_>" -ForEach $Command -Tag Chocolatey, FeatureCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Outputs a message indicating that it disabled the feature" {
Expand All @@ -148,7 +148,7 @@ Describe "choco <_>" -ForEach $Command -Tag Chocolatey, FeatureCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Outputs a message indicating that it enabled the feature" {
Expand All @@ -172,7 +172,7 @@ Describe "choco <_>" -ForEach $Command -Tag Chocolatey, FeatureCommand {
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Outputs a message indicating that it disabled the feature" {
Expand All @@ -192,7 +192,7 @@ Describe "choco <_>" -ForEach $Command -Tag Chocolatey, FeatureCommand {
}

It "Exits with Failure (1)" {
$Output.ExitCode | Should -Be 1
$Output.ExitCode | Should -Be 1 -Because $Output.String
}

It "Outputs a message indicating it didn't find the feature in question" {
Expand All @@ -209,7 +209,7 @@ Describe "choco <_>" -ForEach $Command -Tag Chocolatey, FeatureCommand {
}

It "Exits with Failure (1)" {
$Output.ExitCode | Should -Be 1
$Output.ExitCode | Should -Be 1 -Because $Output.String
}

It "Outputs a message indicating it didn't find the feature in question" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Describe "choco help sections with option <_>" -ForEach $HelpOptions -Tag Chocol
}

It "Exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Outputs the Top-Level Help" {
Expand All @@ -68,7 +68,7 @@ Describe "choco help sections with option <_>" -ForEach $HelpOptions -Tag Chocol
}

It "'choco <_> $helpArgument' exits with Success (0)" {
$Output.ExitCode | Should -Be 0
$Output.ExitCode | Should -Be 0 -Because $Output.String
}

It "Outputs help for <_>" {
Expand Down
Loading

0 comments on commit 05a0deb

Please sign in to comment.