Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ if (Test-Path $licenseFile) {
'optimize'
)

$commandOptions.download = "--append-use-original-location --cert='' --certpassword='' --disable-repository-optimizations --download-location='' --ignore-dependencies --ignore-unfound --installed-packages --internalize --internalize-all-urls --output-directory='' --password='' --prerelease --resources-location='' --skip-download-cache --skip-virus-check --source='' --use-download-cache --user='' --version='' --virus-check --virus-positives-minimum=''"
$commandOptions.download = "--allow-empty-checksums --allow-empty-checksums-secure --append-use-original-location --cert='' --certpassword='' --disable-repository-optimizations --download-location='' --ignore-checksum --ignore-dependencies --ignore-dependencies-from-source='' --ignore-unfound --installed-packages --internalize --internalize-all-urls --output-directory='' --password='' --prerelease --require-checksums --resources-location='' --skip-download-cache --skip-virus-check --source='' --use-download-cache --user='' --version='' --virus-check --virus-positives-minimum=''"
$commandOptions.optimize = "--id='' --reduce-nupkg-only"

# Add pro switches to commands that have additional switches on Pro
Expand Down
35 changes: 35 additions & 0 deletions tests/pester-tests/chocolateyProfile.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,41 @@ Describe "Chocolatey Profile" -Tag Chocolatey, Profile, Environment {
$Completions | Should -Contain "--value=''" -Because $becauseCompletions
}

It "Should list completions for download (Licensed)" -Skip:(!$isLicensed) {
$Command = "choco download "
$Completions = (TabExpansion2 -inputScript $Command -cursorColumn $Command.Length).CompletionMatches.CompletionText

$becauseCompletions = ($Completions -Join ", ")

$Completions | Should -Contain "--allow-empty-checksums" -Because $becauseCompletions
$Completions | Should -Contain "--allow-empty-checksums-secure" -Because $becauseCompletions
$Completions | Should -Contain "--append-use-original-location" -Because $becauseCompletions
$Completions | Should -Contain "--cert=''" -Because $becauseCompletions
$Completions | Should -Contain "--certpassword=''" -Because $becauseCompletions
$Completions | Should -Contain "--disable-repository-optimizations" -Because $becauseCompletions
$Completions | Should -Contain "--download-location=''" -Because $becauseCompletions
$Completions | Should -Contain "--ignore-checksum" -Because $becauseCompletions
$Completions | Should -Contain "--ignore-dependencies" -Because $becauseCompletions
$Completions | Should -Contain "--ignore-dependencies-from-source=''" -Because $becauseCompletions
$Completions | Should -Contain "--ignore-unfound" -Because $becauseCompletions
$Completions | Should -Contain "--installed-packages" -Because $becauseCompletions
$Completions | Should -Contain "--internalize" -Because $becauseCompletions
$Completions | Should -Contain "--internalize-all-urls" -Because $becauseCompletions
$Completions | Should -Contain "--output-directory=''" -Because $becauseCompletions
$Completions | Should -Contain "--password=''" -Because $becauseCompletions
$Completions | Should -Contain "--prerelease" -Because $becauseCompletions
$Completions | Should -Contain "--require-checksums" -Because $becauseCompletions
$Completions | Should -Contain "--resources-location=''" -Because $becauseCompletions
$Completions | Should -Contain "--skip-download-cache" -Because $becauseCompletions
$Completions | Should -Contain "--skip-virus-check" -Because $becauseCompletions
$Completions | Should -Contain "--source=''" -Because $becauseCompletions
$Completions | Should -Contain "--use-download-cache" -Because $becauseCompletions
$Completions | Should -Contain "--user=''" -Because $becauseCompletions
$Completions | Should -Contain "--version=''" -Because $becauseCompletions
$Completions | Should -Contain "--virus-check" -Because $becauseCompletions
$Completions | Should -Contain "--virus-positives-minimum=''" -Because $becauseCompletions
}

It "Should list completions for export" -Skip:$ExportNotPresent {
$Command = "choco export "
$Completions = (TabExpansion2 -inputScript $Command -cursorColumn $Command.Length).CompletionMatches.CompletionText
Expand Down