inspec/docs/resources/directory.md.erb
hannah-radish 9cfc86d2ab Resource documentation update (#2207)
Light formatting changes, change order of example and matchers, slight
color changes

Signed-off-by: hannah-radish <hmaddy@chef.io>
2017-10-03 17:35:10 -04:00

23 lines
827 B
Text

---
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`.
<br>
## Syntax
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' }
end
<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/).