directory resource

[edit on GitHub]

Use the directory Chef 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.

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

Properties

All of the properties available to file may be used with directory.

Matchers

For a full list of available matchers, please visit our matchers page.

© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/directory/