Module: ChefSpec::API::NotificationsMatchers
- Defined in:
- lib/chefspec/api/notifications.rb,
lib/chefspec/deprecations.rb
Overview
Instance Method Summary collapse
- #new_notify ⇒ Object
-
#notify(signature) ⇒ ChefSpec::Matchers::NotificationsMatcher
Assert that a resource notifies another.
Instance Method Details
#new_notify ⇒ Object
130 |
# File 'lib/chefspec/deprecations.rb', line 130 alias_method :new_notify, :notify |
#notify(signature) ⇒ ChefSpec::Matchers::NotificationsMatcher
Assert that a resource notifies another. Given a Chef Recipe that notifies a template resource to restart apache:
ifconfig '10.0.0.1' do
action :add
end
The Examples section demonstrates the different ways to test an ifconfig resource with ChefSpec.
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/chefspec/api/notifications.rb', line 34 def notify(resource, action = nil) if action deprecated "The `notify` matcher arity has changed. Please use" \ " `notify(#{resource.inspect}).to(#{action.to_sym.inspect})`" \ " instead." new_notify(resource).to(action.to_sym) else new_notify(resource) end end |