Created
August 8, 2014 21:22
-
-
Save vinyar/c6a4a1b3fc631634a179 to your computer and use it in GitHub Desktop.
serverspec failing on reg_key numbers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows registry key "HKLM\Software\Policies\Microsoft\Power\PowerSettings\3C0BC021-C8A8-4E07-A973-6B14CBCB2B7E" should have property value "ACSettingIndex", :type_dword, "1200" | |
Failure/Error: it { should have_property_value('ACSettingIndex', :type_dword, '1200')} | |
$exitCode = 1 | |
$ProgressPreference = "SilentlyContinue" | |
try { | |
$success = ((Compare-Object (Get-Item 'Registry::HKLM\Software\Policies\Microsoft\Power\PowerSettings\3C0BC021-C8A8-4E07-A973-6B14CBCB2B7E').GetValue('ACSettingIndex') 4608) -eq $null) | |
if ($success -is [Boolean] -and $success) { $exitCode = 0 } | |
} catch { | |
Write-Output $_.Exception.Message | |
} | |
Write-Output "Exiting with code: $exitCode" | |
exit $exitCode | |
Exiting with code: 1 | |
expected #has_property_value?("ACSettingIndex", :type_dword, "1200") to return true, got false | |
# ./test/integration/windows/spec/localhost/2012_spec.rb:144:in `block (2 levels) in <top (required)>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I didnt find any elegant way of hacking it, so until serverspec is fixed, I converted all of the actual values to what serverspec expects them to be with " .to_s(16) "