inspec/docs/resources/directory.md.erb

43 lines
957 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. All of the matchers available to `file` may be used with `directory`.
## 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:
describe directory('path') do
it { should MATCHER 'value' }
end
## Matchers
2016-09-22 12:43:57 +00:00
This resource may use any of the matchers available to the `file` resource that may be useful when testing a directory.
### be
2016-09-22 12:43:57 +00:00
<%= partial "/shared/matcher_be" %>
### cmp
2016-09-22 12:43:57 +00:00
<%= partial "/shared/matcher_cmp" %>
### eq
2016-09-22 12:43:57 +00:00
<%= partial "/shared/matcher_eq" %>
### include
2016-09-22 12:43:57 +00:00
<%= partial "/shared/matcher_include" %>
### match
2016-09-22 12:43:57 +00:00
<%= partial "/shared/matcher_match" %>
## Examples
2016-09-22 12:43:57 +00:00
None.