Module: Inspec::InputDslHelpers
- Included in:
- DescribeBase, RSpec::Core::ExampleGroup
- Defined in:
- lib/inspec/input_dsl_helpers.rb
Overview
A mixin to provide implementations for the input() DSL methods
Instance Method Summary collapse
-
#input_with_profile_id(profile_id, input_name, options) ⇒ Object
Find or create an input, explicitly named by a profile ID and input name.
Instance Method Details
#input_with_profile_id(profile_id, input_name, options) ⇒ Object
Find or create an input, explicitly named by a profile ID and
input name. Evaluate the input and return the value.
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/inspec/input_dsl_helpers.rb', line 14 def input_with_profile_id(profile_id, input_name, ) if .empty? # Simply an access, no event here Inspec::InputRegistry.find_or_register_input(input_name, profile_id).value else [:priority] = 20 [:provider] = :inline_control_code evt = Inspec::Input.infer_event() Inspec::InputRegistry.find_or_register_input(input_name, profile_id, event: evt).value end end |