File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -280,6 +280,30 @@ exit $error.count
280280 }
281281 }
282282
283+ # This is skipped when not run in CI because it requires a valid license
284+ Context ' Config file updates when a valid license is present' - Tag License - Skip:(-not $env: TEST_KITCHEN ) {
285+ BeforeAll {
286+ Restore-ChocolateyInstallSnapshot
287+
288+ Enable-ChocolateySource - Name hermes- setup
289+
290+ Invoke-Choco install chocolatey- license- business
291+
292+ # Run once post-license-install to ensure the config file is updated with the licensed source
293+ $null = Invoke-Choco list
294+ }
295+
296+ It ' does not overwrite the config file when nothing has changed' {
297+ $originalHash = Get-FileHash - Path " $env: ChocolateyInstall /config/chocolatey.config"
298+
299+ $null = Invoke-Choco list
300+
301+ $newHash = Get-FileHash - Path " $env: ChocolateyInstall /config/chocolatey.config"
302+
303+ $originalHash.Hash | Should - BeExactly $newHash.Hash - Because ' the configuration file should not have changed between runs'
304+ }
305+ }
306+
283307 # This is skipped when not run in CI because it requires a valid license
284308 Context ' Changing licenses after modifying the Chocolatey Licensed repository' - Tag License - Skip:(-not $env: TEST_KITCHEN ) {
285309 BeforeAll {
You can’t perform that action at this time.
0 commit comments