Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

Commit

Permalink
setup tests: with admin rights, variables should be set at Machine le…
Browse files Browse the repository at this point in the history
…vel regardless of UAC

Provided the process is running elevated (i.e. with admin rights),
Chocolatey should always be set up at machine (all users) level.
There is no need to punish security-conscious users who run their systems
with UAC enabled.
  • Loading branch information
jberezanski committed Jun 13, 2014
1 parent 3ef2604 commit eaf8ab2
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions tests/unit/Initialize-Chocolatey.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -551,12 +551,12 @@ Describe "Initialize-Chocolatey" {
Assert-ChocolateyInstallIs $installDir 'Process'
}

It "should create ChocolateyInstall at User scope" {
Assert-ChocolateyInstallIs $installDir 'User'
It "should not create ChocolateyInstall at User scope" {
Assert-ChocolateyInstallIsNull 'User'
}

It "should not create ChocolateyInstall at Machine scope" {
Assert-ChocolateyInstallIsNull 'Machine'
It "should create ChocolateyInstall at Machine scope" {
Assert-ChocolateyInstallIs $installDir 'Machine'
}
}
}
Expand All @@ -578,12 +578,12 @@ Describe "Initialize-Chocolatey" {
Assert-ChocolateyInstallIs $installDir 'Process'
}

It "should create ChocolateyInstall at User scope" {
Assert-ChocolateyInstallIs $installDir 'User'
It "should not ChocolateyInstall at User scope" {
Assert-ChocolateyInstallIsNull 'User'
}

It "should not create ChocolateyInstall at Machine scope" {
Assert-ChocolateyInstallIsNull 'Machine'
It "should create ChocolateyInstall at Machine scope" {
Assert-ChocolateyInstallIs $installDir 'Machine'
}
}
}
Expand All @@ -604,13 +604,13 @@ Describe "Initialize-Chocolatey" {
Assert-ChocolateyInstallIs $installDir 'Process'
}

# this is unexpected - different behavior than both when chocolateyPath is not passed and when passed chocolateyPath is different than environment
It "should create ChocolateyInstall at User scope" {
Assert-ChocolateyInstallIs $installDir 'User'
It "should not create ChocolateyInstall at User scope" {
Assert-ChocolateyInstallIsNull 'User'
}

It "should not create ChocolateyInstall at Machine scope" {
Assert-ChocolateyInstallIsNull 'Machine'
# this is unexpected - different behavior than both when chocolateyPath is not passed and when passed chocolateyPath is different than environment
It "should create ChocolateyInstall at Machine scope" {
Assert-ChocolateyInstallIs $installDir 'Machine'
}
}
}
Expand Down Expand Up @@ -845,12 +845,12 @@ Describe "Initialize-Chocolatey" {
Assert-OnPath $binDir 'Process'
}

It "should add bin to PATH at User scope" {
Assert-OnPath $binDir 'User'
It "should not add bin to PATH at User scope" {
Assert-NotOnPath $binDir 'User'
}

It "should not add bin to PATH at Machine scope" {
Assert-NotOnPath $binDir 'Machine'
It "should add bin to PATH at Machine scope" {
Assert-OnPath $binDir 'Machine'
}
}
}
Expand Down

0 comments on commit eaf8ab2

Please sign in to comment.