mirror of
https://github.com/inspec/inspec
synced 2024-11-10 23:24:18 +00:00
Fix directory resource output and exists check (#1950)
* Fix to_s on directory resource The `to_s` method on the `directory` resource is not defined in the correct class, leading `directory` resources to be printed as the parent resource (`file`) instead. Signed-off-by: Adam Leff <adam@leff.co> * Directory existence should check to see if it's a directory Signed-off-by: Adam Leff <adam@leff.co>
This commit is contained in:
parent
c808712182
commit
b4f772546b
1 changed files with 7 additions and 3 deletions
|
@ -13,9 +13,13 @@ module Inspec::Resources
|
|||
it { should be_directory }
|
||||
end
|
||||
"
|
||||
end
|
||||
|
||||
def to_s
|
||||
"Directory #{@path}"
|
||||
def exist?
|
||||
file.exist? && file.directory?
|
||||
end
|
||||
|
||||
def to_s
|
||||
"Directory #{source_path}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue