Merge pull request #199 from chef/fix-hasty-skip

Merged change 69ce2f13-7067-410f-972d-c87e55a436a7

From review branch fix-hasty-skip into master

Signed-off-by: chartmann <chartmann@chef.io>
This commit is contained in:
chef-delivery 2015-11-02 16:15:11 -08:00
commit 7d655c8a29

View file

@ -95,7 +95,13 @@ module Inspec
define_method :control do |*args, &block|
id = args[0]
opts = args[1] || {}
return if @skip_profile
# Skip the control if the resource triggered a skip;
# However: when this is run on a mock backend, do not skip it.
# This is e.g. relevant for JSON generation, where we need all
# controls.
return if @skip_profile && os[:family] != 'unknown'
__register_rule rule_class.new(id, opts, &block)
end