Start getting unit tests passing again

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
Clinton Wolfe 2019-02-25 19:48:58 -05:00
parent 883572fcbb
commit 8ef5eb46b1
2 changed files with 6 additions and 4 deletions

View file

@ -49,7 +49,7 @@ module Inspec
raise error, "Profile '#{error.profile_name}' does not have any inputs"
end
unless list[profile].key?(name)
unless inputs_by_profile[profile].key?(name)
error = Inspec::InputRegistry::InputLookupError.new
error.input_name = name
error.profile_name = profile
@ -144,6 +144,8 @@ module Inspec
def bind_inputs_from_metadata(profile_obj, profile_metadata_obj)
# TODO: move this into a core plugin
# TODO: add deprecation stuff
return if profile_metadata_obj.nil? # Metadata files are technically optional
if profile_metadata_obj.params.key?(:attributes) && profile_metadata_obj.params[:attributes].is_a?(Array)
profile_metadata_obj.params[:attributes].each do |input|
input_options = input.dup

View file

@ -121,8 +121,8 @@ module Inspec
# The AttributeRegistry is in charge of keeping track of inputs;
# it is the single source of truth. Now that we have a profile object,
# we can create any inputs that were provided by various mechanisms.
Inspec::AttributeRegistry.bind_profile_inputs(
profile: self, # Every input only exists in the context of a profile
Inspec::InputRegistry.bind_profile_inputs(
self, # Every input only exists in the context of a profile
# Remaining args are possible sources of inputs
# TODO: deprecation checks throughout
cli_attr_files: options[:attrs],
@ -594,7 +594,7 @@ module Inspec
f = load_rule_filepath(prefix, rule)
load_rule(rule, f, controls, groups)
end
params[:inputs] = @runner_context.inputs
params[:inputs] = Inspec::InputRegistry.list_inputs_for_profile(@profile_id)
params
end