Module: ChefSpec::API::StubsFor::ClassMethods
- Included in:
- ChefSpec::API::StubsFor
- Defined in:
- lib/chefspec/api/stubs_for.rb
Instance Method Summary collapse
- #included(klass) ⇒ Object private
-
#stubs_for_current_value(*args, &block) ⇒ void
(also: #stubs_for_current_resource)
Register stubs for current_value objects.
-
#stubs_for_provider(*args, &block) ⇒ void
Register stubs for provider objects.
-
#stubs_for_resource(*args, **kwargs, &block) ⇒ void
Register stubs for resource objects.
Instance Method Details
#included(klass) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
128 129 130 131 132 |
# File 'lib/chefspec/api/stubs_for.rb', line 128 def included(klass) super # Inject classmethods into the group. klass.extend(ClassMethods) end |
#stubs_for_current_value(*args, &block) ⇒ void Also known as: stubs_for_current_resource
This method returns an undefined value.
Register stubs for current_value objects.
117 118 119 |
# File 'lib/chefspec/api/stubs_for.rb', line 117 def stubs_for_current_value(*args, &block) before { stubs_for_current_value(*args, &block) } end |
#stubs_for_provider(*args, &block) ⇒ void
This method returns an undefined value.
Register stubs for provider objects.
123 124 125 |
# File 'lib/chefspec/api/stubs_for.rb', line 123 def stubs_for_provider(*args, &block) before { stubs_for_provider(*args, &block) } end |
#stubs_for_resource(*args, **kwargs, &block) ⇒ void
This method returns an undefined value.
Register stubs for resource objects.
The ‘target` parameter can select either a resource string like `’package’‘, a resource name like `’package’‘, or `nil` for all resources.
112 113 114 |
# File 'lib/chefspec/api/stubs_for.rb', line 112 def stubs_for_resource(*args, **kwargs, &block) before { stubs_for_resource(*args, **kwargs, &block) } end |