mirror of
https://github.com/inspec/inspec
synced 2024-09-21 06:51:56 +00:00
Updates directory resource (#2516)
* Updates directory resource Signed-off-by: kagarmoe <kgarmoe@chef.io> * Updates syntax example Signed-off-by: kagarmoe <kgarmoe@chef.io>
This commit is contained in:
parent
bc3c5039f3
commit
15d4564c3a
1 changed files with 9 additions and 4 deletions
|
@ -4,20 +4,25 @@ title: About the directory Resource
|
|||
|
||||
# directory
|
||||
|
||||
Use the `directory` InSpec audit resource to test if the file type is a directory. This is equivalent to using the `file` resource and the `be_directory` matcher, but provides a simpler and more direct way to test directories. All of the matchers available to `file` may be used with `directory`.
|
||||
Use the `directory` InSpec audit resource to test if the file type is a directory. This is equivalent to using the `file` resource and the `be_directory` matcher, but provides a simpler and more direct way to test directories.
|
||||
|
||||
<br>
|
||||
|
||||
## Syntax
|
||||
|
||||
A `directory` resource block declares the location of the directory to be tested, and then one (or more) matchers:
|
||||
A `directory` resource block declares the location of the directory to be tested, and then one (or more) matchers.
|
||||
|
||||
describe directory('path') do
|
||||
it { should MATCHER 'value' }
|
||||
its('property') { should cmp 'value' }
|
||||
end
|
||||
|
||||
<br>
|
||||
|
||||
## Supported Resource Properties
|
||||
|
||||
All of the properties available to `file` may be used with `directory`.
|
||||
|
||||
<br>
|
||||
## Matchers
|
||||
|
||||
This resource may use any of the matchers available to the `file` resource that may be useful when testing a directory. For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
||||
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
||||
|
|
Loading…
Reference in a new issue