File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,16 @@ Describe 'Chocolatey script' -Tag 'WindowsOnly' -Skip:$SkipUnsupported {
3939 }
4040 }
4141
42+ It ' Passes --yes to choco upgrade to suppress interactive prompts' {
43+ $dep = New-PSDependFixture - DependencyName ' git' - DependencyType ' Chocolatey' - Version ' 2.0.2'
44+ InModuleScope PSDepend - Parameters @ { Dep = $dep ; ScriptPath = $script :ScriptPath } {
45+ & $ScriptPath - Dependency $Dep - Force
46+ }
47+ Should - Invoke - CommandName Invoke-ExternalCommand - ModuleName PSDepend - Times 1 - Exactly - ParameterFilter {
48+ $Arguments -contains ' upgrade' -and $Arguments -contains ' --yes'
49+ }
50+ }
51+
4252 It ' Invokes choco upgrade with -Force when -Force switch is set' {
4353 $dep = New-PSDependFixture - DependencyName ' git' - DependencyType ' Chocolatey' - Version ' 2.0.2'
4454 InModuleScope PSDepend - Parameters @ { Dep = $dep ; ScriptPath = $script :ScriptPath } {
You can’t perform that action at this time.
0 commit comments