Skip to content

Commit 9062644

Browse files
committed
(#886) Use specific strings for configurations
Update the packages.config to be easier to read in the Pester tests. Update the configurations to use specific strings instead of all of them being the same "string". This will allow us to identify that they are actually what they're supposed to be.
1 parent dcbe191 commit 9062644

File tree

1 file changed

+41
-19
lines changed

1 file changed

+41
-19
lines changed

tests/chocolatey-tests/commands/choco-install.Tests.ps1

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -205,19 +205,41 @@ Describe "choco install" -Tag Chocolatey, InstallCommand {
205205
@"
206206
<?xml version="1.0" encoding="utf-8"?>
207207
<packages>
208-
<package id="installpackage" prerelease="true" overrideArguments="true"
209-
notSilent="true" allowDowngrade="true" forceDependencies="true"
210-
skipAutomationScripts="true" user="string" password="string" cert="string"
211-
certPassword="string" ignoreChecksums="true" allowEmptyChecksums="true"
212-
allowEmptyChecksumsSecure="true" requireChecksums="true"
213-
downloadChecksum="string" downloadChecksum64="string"
214-
downloadChecksumType="sha512" downloadChecksumType64="sha512"
215-
ignorePackageExitCodes="true" usePackageExitCodes="true"
216-
stopOnFirstFailure="true" exitWhenRebootDetected="true"
217-
ignoreDetectedReboot="true" disableRepositoryOptimizations="true"
218-
acceptLicense="true" confirm="true" limitOutput="true" cacheLocation="Z:\"
219-
failOnStderr="true" useSystemPowershell="true" noProgress="true"
220-
force="true" executionTimeout="1000"
208+
<package
209+
id="installpackage"
210+
prerelease="true"
211+
overrideArguments="true"
212+
notSilent="true"
213+
allowDowngrade="true"
214+
forceDependencies="true"
215+
skipAutomationScripts="true"
216+
user="user"
217+
password="string"
218+
cert="cert"
219+
certPassword="string"
220+
ignoreChecksums="true"
221+
allowEmptyChecksums="true"
222+
allowEmptyChecksumsSecure="true"
223+
requireChecksums="true"
224+
downloadChecksum="downloadChecksum"
225+
downloadChecksum64="downloadChecksum64"
226+
downloadChecksumType="downloadChecksumType"
227+
downloadChecksumType64="downloadChecksumType64"
228+
ignorePackageExitCodes="true"
229+
usePackageExitCodes="true"
230+
stopOnFirstFailure="true"
231+
exitWhenRebootDetected="true"
232+
ignoreDetectedReboot="true"
233+
disableRepositoryOptimizations="true"
234+
acceptLicense="true"
235+
confirm="true"
236+
limitOutput="true"
237+
cacheLocation="Z:\"
238+
failOnStderr="true"
239+
useSystemPowershell="true"
240+
noProgress="true"
241+
force="true"
242+
executionTimeout="1000"
221243
/>
222244
</packages>
223245
"@ | Out-File $env:CHOCOLATEY_TEST_PACKAGES_PATH\alloptions.packages.config -Encoding utf8
@@ -246,11 +268,11 @@ Describe "choco install" -Tag Chocolatey, InstallCommand {
246268
# SkipAutomationScripts sets configuration option SkipPackageInstallProvider
247269
@{ Option = "SkipPackageInstallProvider" ; ExpectedValue = "True" }
248270
# User is expanded to Username
249-
@{ Option = "Username" ; ExpectedValue = "string" }
271+
@{ Option = "Username" ; ExpectedValue = "user" }
250272
# Password should *not* be output in the logging
251273
# @{ Option = "Password" ; ExpectedValue = "string" }
252274
# Cert is expanded to Certificate
253-
@{ Option = "Certificate" ; ExpectedValue = "string" }
275+
@{ Option = "Certificate" ; ExpectedValue = "cert" }
254276
# CertPassword should *not* be output in the logging
255277
# @{ Option = "CertPassword" ; ExpectedValue = "string" }
256278
# IgnoreChecksums sets ChecksumFiles to False
@@ -259,10 +281,10 @@ Describe "choco install" -Tag Chocolatey, InstallCommand {
259281
# @{ Option = "RequireChecksums" ; ExpectedValue = "True" }
260282
@{ Option = "AllowEmptyChecksums" ; ExpectedValue = "False" }
261283
@{ Option = "AllowEmptyChecksumsSecure" ; ExpectedValue = "False" }
262-
@{ Option = "DownloadChecksum" ; ExpectedValue = "string" }
263-
@{ Option = "DownloadChecksum64" ; ExpectedValue = "string" }
264-
@{ Option = "DownloadChecksumType" ; ExpectedValue = "sha512" }
265-
@{ Option = "DownloadChecksumType64" ; ExpectedValue = "sha512" }
284+
@{ Option = "DownloadChecksum" ; ExpectedValue = "downloadChecksum" }
285+
@{ Option = "DownloadChecksum64" ; ExpectedValue = "downloadChecksum64" }
286+
@{ Option = "DownloadChecksumType" ; ExpectedValue = "downloadChecksumType" }
287+
@{ Option = "DownloadChecksumType64" ; ExpectedValue = "downloadChecksumType64" }
266288
# UsePackageExitCodes and IgnorePackageExitCodes set the same setting, but are opposite of each other.
267289
# UsePackageExitCodes is evaluated last, so takes precidence.
268290
# @{ Option = "IgnorePackageExitCodes" ; ExpectedValue = "True" }

0 commit comments

Comments
 (0)