You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It 'Returns the value of $env:ChocolateyInstall if set' {
26
+
$env:ChocolateyInstall| Should -Not-BeNullOrEmpty -Because 'it should be set for this test'
27
+
Get-ChocolateyPath-PathType InstallPath | Should -BeExactly $env:ChocolateyInstall
28
+
}
29
+
30
+
# Skip this if the system choco install path does not exist, it will return null in that case, and we shouldn't be creating paths
31
+
# at this level for a test.
32
+
It 'Falls back to $env:ProgramData\chocolatey if $env:ChocolateyInstall is not set'-Skip:(-not (Test-Path"$env:ProgramData\chocolatey")) {
33
+
$env:ChocolateyInstall=''
34
+
Get-ChocolateyPath-PathType InstallPath | Should -Be "$env:ProgramData\chocolatey"
35
+
}
36
+
37
+
# Skip this if the system choco install path does not exist, it will return null in that case, and we shouldn't be creating paths
38
+
# at this level for a test.
39
+
It 'Falls back to $env:SystemDrive\ProgramData\chocolatey if $env:ChocolateyInstall and $env:ProgramData are not set'-Skip:(-not (Test-Path"$env:SystemDrive\ProgramData\chocolatey")) {
40
+
$env:ChocolateyInstall=''
41
+
$env:ProgramData=''
42
+
Get-ChocolateyPath-PathType InstallPath | Should -Be "$env:SystemDrive\ProgramData\chocolatey"
43
+
}
44
+
45
+
It 'Falls back to a path relative to the DLL location if none of the environment variables are set' {
0 commit comments