inspec/lib/resources/directory.rb

22 lines
644 B
Ruby
Raw Normal View History

# encoding: utf-8
2015-10-06 18:55:44 +02:00
# author: Dominik Richter
# author: Christoph Hartmann
require 'resources/file'
2015-10-26 04:04:18 +01:00
module Inspec::Resources
class Directory < FileResource
name 'directory'
2015-11-27 14:02:38 +01:00
desc 'Use the directory InSpec audit resource to test if the file type is a directory. This is equivalent to using the file InSpec audit 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.'
example "
describe directory('path') do
it { should be_directory }
end
"
end
def to_s
"Directory #{@path}"
end
end