How was value: ever working?

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
Clinton Wolfe 2019-04-30 23:27:06 -04:00
parent b4ae6cb342
commit f54abf9719
2 changed files with 7 additions and 6 deletions

View file

@ -35,7 +35,7 @@ module Inspec
options[:priority] = 20
options[:provider] = :inline_control_code
evt = Inspec::Input.infer_event(options)
Inspec::InputRegistry.find_or_register_input(input_name, profile_name, event: evt).value
Inspec::InputRegistry.find_or_register_input(input_name, profile_id, event: evt).value
end
end

View file

@ -65,14 +65,15 @@ end
class RSpec::Core::ExampleGroup
# This DSL method allows us to access the values of inputs within InSpec tests
def attribute(name)
Inspec::InputRegistry.find_or_register_input(name, self.class.metadata[:profile_id]).value
def attribute(name, options = {})
Inspec::InputRegistry.find_or_register_input(name, self.class.metadata[:profile_id], options).value
end
define_example_method :attribute
def input_obj(name)
Inspec::InputRegistry.find_or_register_input(name, self.class.metadata[:profile_id])
def input_object(name, options = {})
Inspec::InputRegistry.find_or_register_input(name, self.class.metadata[:profile_id], options)
end
define_example_method :input_obj
define_example_method :input_object
# Here, we have to ensure our method_missing gets called prior
# to RSpec::Core::ExampleGroup.method_missing (the class method).