Skip to content

Commit

Permalink
Merge pull request #3553 from corbob/update-tests
Browse files Browse the repository at this point in the history
(#3503, #3513) Add null check to Command Name
  • Loading branch information
vexx32 authored Nov 6, 2024
2 parents bb8b8a5 + 53ed5aa commit e0c728d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/chocolatey/infrastructure.app/services/NugetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ it is possible that incomplete package lists are returned from a command
// The main scenario where we desire the decrypted arguments during a list sequence is to display them when verbose output is selected.
// This is done by default on the `info` command, and by request on the `list` command. As such, we are going to validate it's that scenario
// to avoid needlessly decrypting the arguments file.
var shouldDecryptArguments = (
var shouldDecryptArguments = !string.IsNullOrWhiteSpace(config.CommandName) &&
(
config.CommandName.Equals("info", StringComparison.OrdinalIgnoreCase) ||
config.CommandName.Equals("list", StringComparison.OrdinalIgnoreCase)
) &&
Expand Down
3 changes: 2 additions & 1 deletion tests/pester-tests/commands/choco-upgrade.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,8 @@ To upgrade a local, or remote file, you may use:

$Setup = Invoke-Choco install $DependentPackage.Name --version $DependentPackage.Version --confirm
$Setup2 = Invoke-Choco install $BasePackage --version 1.0.0 --confirm
$Output = Invoke-Choco upgrade $PackageName --confirm --except="'chocolatey'" $Argument
# We need to exclude packages that are in Test Kitchen but not the other environments.
$Output = Invoke-Choco upgrade $PackageName --confirm --except="chocolatey,chocolatey.extension,chocolatey-agent,pester,chocolatey-license-business" $Argument
}

It "Exits with expected result (<ExpectedExit>)" {
Expand Down

0 comments on commit e0c728d

Please sign in to comment.