inspec/docs/resources/directory.md.erb
Unknown 5c1467dfe9 Update software name from InSpec to Chef Inspec
Signed-off-by: IanMadd <maddaus@protonmail.com>
2019-04-29 15:16:56 -04:00

40 lines
1 KiB
Text

---
title: About the directory Resource
platform: os
---
# directory
Use the `directory` Chef InSpec audit resource to test if the file type is a directory. This is equivalent to using the [`file` resource](https://www.inspec.io/docs/reference/resources/file/) and the `be_directory` matcher, but provides a simpler and more direct way to test directories.
<br>
## Availability
### Installation
This resource is distributed along with Chef InSpec itself. You can use it automatically.
### Version
This resource first became available in v1.0.0 of InSpec.
## Syntax
A `directory` resource block declares the location of the directory to be tested, and then one (or more) matchers.
describe directory('path') do
its('property') { should cmp 'value' }
end
<br>
## Properties
All of the properties available to [`file`](https://www.inspec.io/docs/reference/resources/file/) may be used with `directory`.
<br>
## Matchers
For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).