2016-09-22 14:43:57 +02:00
---
title: About the directory Resource
2018-02-15 18:28:15 -06:00
platform: os
2016-09-22 14:43:57 +02:00
---
# directory
2018-02-15 18:28:15 -06:00
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 14:43:57 +02:00
2017-10-03 14:35:10 -07:00
<br>
2016-09-27 12:03:23 -07:00
## Syntax
2016-09-22 14:43:57 +02:00
2018-02-06 03:27:09 -08:00
A `directory` resource block declares the location of the directory to be tested, and then one (or more) matchers.
2016-09-22 14:43:57 +02:00
describe directory('path') do
2018-02-06 03:27:09 -08:00
its('property') { should cmp 'value' }
2016-09-22 14:43:57 +02:00
end
2017-10-03 14:35:10 -07:00
<br>
2016-09-22 14:43:57 +02:00
2018-02-15 06:33:22 -08:00
## Properties
2018-02-06 03:27:09 -08:00
All of the properties available to `file` may be used with `directory`.
<br>
2018-02-15 18:34:11 -08:00
2017-10-03 14:35:10 -07:00
## Matchers
2016-09-22 14:43:57 +02:00
2018-02-15 19:07:18 -08:00
For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).