Module: ChefSpec::API::CronMatchers
- Defined in:
- lib/chefspec/api/cron.rb
Overview
Instance Method Summary collapse
-
#create_cron(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
cron
resource exists in the Chef run with the action:create
. -
#delete_cron(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
cron
resource exists in the Chef run with the action:delete
.
Instance Method Details
#create_cron(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a cron
resource exists in the Chef run with the action :create
. Given a Chef Recipe that creates “ping nagios” as a cron
:
cron 'ping nagios' do
action :create
end
The Examples section demonstrates the different ways to test a cron
resource with ChefSpec.
39 40 41 |
# File 'lib/chefspec/api/cron.rb', line 39 def create_cron(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:cron, :create, resource_name) end |
#delete_cron(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a cron
resource exists in the Chef run with the action :delete
. Given a Chef Recipe that deletes “ping nagios” as a cron
:
cron 'ping nagios' do
action :delete
end
The Examples section demonstrates the different ways to test a cron
resource with ChefSpec.
76 77 78 |
# File 'lib/chefspec/api/cron.rb', line 76 def delete_cron(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:cron, :delete, resource_name) end |