inspec/docs/resources/directory.md.erb

29 lines
759 B
Text
Raw Normal View History

2016-09-22 12:43:57 +00:00
---
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.
2016-09-22 12:43:57 +00:00
<br>
## Syntax
2016-09-22 12:43:57 +00:00
A `directory` resource block declares the location of the directory to be tested, and then one (or more) matchers.
2016-09-22 12:43:57 +00:00
describe directory('path') do
its('property') { should cmp 'value' }
2016-09-22 12:43:57 +00:00
end
<br>
2016-09-22 12:43:57 +00:00
## Supported Resource Properties
All of the properties available to `file` may be used with `directory`.
<br>
## Matchers
2016-09-22 12:43:57 +00:00
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).