From f5c928c0fcf78c72730e2f76575e34752b52284e Mon Sep 17 00:00:00 2001 From: jamescott Date: Wed, 21 Oct 2015 19:52:52 -0700 Subject: [PATCH] add directory resource --- docs/resources.rst | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/docs/resources.rst b/docs/resources.rst index a93f746ce..adc88083e 100644 --- a/docs/resources.rst +++ b/docs/resources.rst @@ -414,11 +414,39 @@ The following examples show how to use this InSpec resource in a test. -directory -===================================================== -Use the ``directory`` InSpec resource to xxxxx. -IN_PROGRESS +directory -- DONE +===================================================== +Use the ``directory`` InSpec resource to test if the file type is a directory. This is equivalent to using the ``file`` InSpec resource and the ``be_directory`` matcher, but provides a simpler and more direct way to test directories. All of the matchers available to the ``file`` resource that may be used with testing directories may be used with this resource. + +Syntax -- DONE +----------------------------------------------------- +A ``directory`` InSpec resource block declares the location of the directory to be tested, and then one (or more) matchers. For example: + +.. code-block:: ruby + + describe directory('path') do + it { should MATCHER 'value' } + end + +Matchers -- DONE +----------------------------------------------------- +This InSpec resource may use any of the matchers available to the ``file`` resource that are useful for testing a directory. + +.. +.. Examples +.. ----------------------------------------------------- +.. The following examples show how to use this InSpec resource in a test. +.. +.. **xxxxx** +.. +.. xxxxx +.. +.. **xxxxx** +.. +.. xxxxx +.. +