Class: RSpec::Core::ExampleGroup
- Inherits:
-
Object
- Object
- RSpec::Core::ExampleGroup
- Defined in:
- lib/inspec/rspec_extensions.rb
Instance Method Summary collapse
- #attribute(name, options = {}) ⇒ Object
-
#input(input_name, options = {}) ⇒ Object
This DSL method allows us to access the values of inputs within InSpec tests.
- #input_object(name) ⇒ Object
Methods included from Inspec::DescribeDslLazyLoader
Methods included from Inspec::TestDslLazyLoader
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Inspec::DescribeDslLazyLoader
Instance Method Details
#attribute(name, options = {}) ⇒ Object
87 88 89 90 |
# File 'lib/inspec/rspec_extensions.rb', line 87 def attribute(name, = {}) Inspec.deprecate(:attrs_dsl, "Input name: #{name}, Profile: #{self.class.[:profile_id]}") input(name, ) end |
#input(input_name, options = {}) ⇒ Object
This DSL method allows us to access the values of inputs within InSpec tests
68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/inspec/rspec_extensions.rb', line 68 def input(input_name, = {}) profile_id = self.class.[:profile_id] 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 |
#input_object(name) ⇒ Object
82 83 84 |
# File 'lib/inspec/rspec_extensions.rb', line 82 def input_object(name) Inspec::InputRegistry.find_or_register_input(name, self.class.[:profile_id]) end |