Skip to content

Commit

Permalink
Merge pull request #1034 from corbob/fixup-tests-master
Browse files Browse the repository at this point in the history
Update Pester Tests on master branch
  • Loading branch information
gep13 authored Dec 21, 2023
2 parents 8db7e02 + f741d3e commit cfa8b1a
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Import-Module ./helpers/gui-helpers.psm1
Import-Module ../helpers/gui-helpers.psm1

Describe "chocolateyguicli" -Tag ChocolateyGuiCli {
BeforeDiscovery {
Expand Down Expand Up @@ -29,20 +29,21 @@ Describe "chocolateyguicli" -Tag ChocolateyGuiCli {
$Output.String | Should -Match $Name
}
}

Context "Toggles the feature (<_.Name>) successfully" -ForEach $Features {
BeforeAll {
$Outputs = if ($Enabled) {
Invoke-GuiCli feature disable --name $_.Name
Invoke-GuiCli feature enable --name $_.Name
if ($Enabled) {
$DisableOutput = Invoke-GuiCli feature disable --name $_.Name
$EnableOutput = Invoke-GuiCli feature enable --name $_.Name
} else {
Invoke-GuiCli feature enable --name $_.Name
Invoke-GuiCli feature disable --name $_.Name
$EnableOutput = Invoke-GuiCli feature enable --name $_.Name
$DisableOutput = Invoke-GuiCli feature disable --name $_.Name
}
}

It "Should exit success" {
$Outputs.ExitCode | Should -Not -Contain 1
It "Should exit success (0)" {
$EnableOutput.ExitCode | Should -Be 0 -Because $EnableOutput.String
$DisableOutput.ExitCode | Should -Be 0 -Because $DisableOutput.String
}
}
}

0 comments on commit cfa8b1a

Please sign in to comment.