This commit is contained in:
Dominik Richter 2016-01-03 09:49:40 +01:00
parent 8953278204
commit 26c0cd0871
2 changed files with 3 additions and 7 deletions

View file

@ -5,7 +5,7 @@
# license: All rights reserved
module Inspec::Resources
class File < Inspec.resource(1)
class File < Inspec.resource(1) # rubocop:disable Metrics/ClassLength
name 'file'
desc 'Use the file InSpec audit resource to test all system file types, including files, directories, symbolic links, named pipes, sockets, character devices, block devices, and doors.'
example "

View file

@ -32,12 +32,8 @@ class Mount < Inspec.resource(1)
def count
mounted = file.mounted
if !mounted.nil? && !mounted.stdout.nil? && !mounted.stdout.lines.nil?
mounted.stdout.lines.count
else
nil
end
return nil if mounted.nil? || mounted.stdout.nil?
mounted.stdout.lines.count
end
def method_missing(name)