In mock setups like inspec check the command resource was executed since inspec.os.name was “” instead of unknown. I changed to nil to catch that case. (#2056)

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
This commit is contained in:
Christoph Hartmann 2017-08-14 15:03:47 +02:00 committed by Adam Leff
parent b97b9c0fb9
commit 69cf0514f2

View file

@ -47,7 +47,7 @@ module Inspec::Resources
def exist?
# silent for mock resources
return false if inspec.os[:name].to_s == 'unknown'
return false if inspec.os.name.nil?
if inspec.os.linux?
res = inspec.backend.run_command("bash -c 'type \"#{@command}\"'")