mirror of
https://github.com/inspec/inspec
synced 2024-11-10 23:24:18 +00:00
add documentation for registry_key backslashes and #1281
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
This commit is contained in:
parent
6f6f3985a6
commit
afc7859fdb
1 changed files with 24 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue