address some review feedback

This commit is contained in:
James Truher committed 2016-08-30 16:15:10 -07:00
1 parent f4ed351f86
commit 3ceca01b64
3 files changed
+29 -17

No files matched your search

@@ -3,19 +3,8 @@
# determine whether we're elevated
Describe "Set-Date" -Tag "CI" {
BeforeAll {
if ( $IsWindows ) {
$identity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$windowsPrincipal = new-object 'Security.Principal.WindowsPrincipal' $identity
if ($windowsPrincipal.IsInRole("Administrators") -eq 1) { $IsElevated = $true } else { $IsElevated = $false }
}
else {
if ( (whoami) -match "root" ) {
$IsElevated = $true
}
else {
$IsElevated = $false
}
}
Import-Module (join-path $psscriptroot "../../Common/Test.Helpers.psm1")
$IsElevated = Test-IsElevated
}
It "Set-Date should be able to set the date in an elevated context" -Skip:(! $IsElevated) {
{ get-date | set-date } | Should not throw