lib/inspec/profile.rb in inspec-2.3.10 vs lib/inspec/profile.rb in inspec-2.3.23

- old
+ new

@@ -124,15 +124,17 @@ @supports_runtime = metadata.supports_runtime? register_metadata_attributes end def register_metadata_attributes - if metadata.params.key?(:attributes) + if metadata.params.key?(:attributes) && metadata.params[:attributes].is_a?(Array) metadata.params[:attributes].each do |attribute| attr_dup = attribute.dup name = attr_dup.delete(:name) @runner_context.register_attribute(name, attr_dup) end + elsif metadata.params.key?(:attributes) + Inspec::Log.warn 'Attributes must be defined as an Array. Skipping current definition.' end end def name metadata.params[:name]