Search code examples
chef-infrainspec

How to compare binary registry key value in Chef InSpec?


If I have a registry key with a REG_BINARY property value of 01 00 00 00, when I compare that value in InSpec, do I compare with that binary value as well? Or does it get converted?

e.g. should my test be

describe registry_key('...') do
  its('value_here') { should eq '01 00 00 00' }
end

or should the comparison part be:

its('value_here') { should eq 1 }

Solution

  • InSpec appears to return it as an array, so the check should be:

    its('value_here') { should eq [1,0,0,0] }