4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/inspec/feature/runner.rb', line 4
def self.with_feature(feature_name, opts = {}, &feature_implementation)
config = opts[:config] || Inspec::Feature::Config.new
logger = opts[:logger] || Inspec::Log
logger.debug("Prepping to run feature '#{feature_name}'")
feature = config[feature_name]
unless feature
logger.warn "Unrecognized feature name '#{feature_name}'"
end
if feature.nil? || feature&.no_preview? || feature&.previewable?
yield feature_implementation
end
end
|