add documentation for registry_key backslashes and #1281

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
This commit is contained in:
Christoph Hartmann 2017-04-06 23:43:48 +02:00
parent 6f6f3985a6
commit afc7859fdb

View file

@ -48,6 +48,19 @@ or may be enclosed in a double-quoted string with an extra backslash as an escap
"HKCU\\SOFTWARE\\path\\to\\key\\Themes"
<p class="warning">
Please make sure that you use backslashes instead of forward slashes. Forward slashes will not work for registry keys.
</p>
# The following will not work:
# describe registry_key('HKLM/SOFTWARE/Microsoft/NET Framework Setup/NDP/v4/Full/1033') do
# its('Release') { should eq 378675 }
# end
# You should use:
describe registry_key('HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\1033') do
its('Release') { should eq 378675 }
end
## Matchers
This InSpec audit resource has the following matchers:
@ -126,6 +139,17 @@ The `name` matcher tests the value for the specified registry setting:
its('name') { should eq 'value' }
<p class="warning">
Any name with a dot will not work as expected: <code>its('explorer.exe') { should eq 'test' }</code>. This issue is tracked in <a href="https://github.com/chef/inspec/issues/1281">https://github.com/chef/inspec/issues/1281</a>
</p>
# instead of:
# its('explorer.exe') { should eq 'test' }
# use the following solution:
it { should have_property_value('explorer.exe', :string, 'test') }
## Examples
The following examples show how to use this InSpec audit resource.