diff --git a/lib/resources/file.rb b/lib/resources/file.rb index 17dd2e211..0e7687acc 100644 --- a/lib/resources/file.rb +++ b/lib/resources/file.rb @@ -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 " diff --git a/lib/resources/mount.rb b/lib/resources/mount.rb index 44519ac50..8be324ad5 100644 --- a/lib/resources/mount.rb +++ b/lib/resources/mount.rb @@ -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)