Module: ChefSpec::API::LaunchdMatchers
- Defined in:
- lib/chefspec/api/launchd.rb
Overview
Instance Method Summary collapse
-
#create_if_missing_launchd(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
launchdresource exists in the Chef run with the action:create_if_missing. -
#create_launchd(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
launchdresource exists in the Chef run with the action:create. -
#delete_launchd(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
launchdresource exists in the Chef run with the action:delete. -
#disable_launchd(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
launchdresource exists in the Chef run with the action:disable. -
#enable_launchd(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
launchdresource exists in the Chef run with the action:enable.
Instance Method Details
#create_if_missing_launchd(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a launchd resource exists in the Chef run with the action :create_if_missing. Given a Chef Recipe that creates if missing the launchd daemon “com.chef.every15”:
launchd 'com.chef.every15' do
action :create_if_missing
end
The Examples section demonstrates the different ways to test a launchd resource with ChefSpec.
60 61 62 |
# File 'lib/chefspec/api/launchd.rb', line 60 def create_if_missing_launchd(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:launchd, :create_if_missing, resource_name) end |
#create_launchd(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a launchd resource exists in the Chef run with the action :create. Given a Chef Recipe that creates the launchd daemon “com.chef.every15”:
launchd 'com.chef.every15' do
action :create
end
The Examples section demonstrates the different ways to test a launchd resource with ChefSpec.
31 32 33 |
# File 'lib/chefspec/api/launchd.rb', line 31 def create_launchd(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:launchd, :create, resource_name) end |
#delete_launchd(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a launchd resource exists in the Chef run with the action :delete. Given a Chef Recipe that deletes the launchd daemon “com.chef.every15”:
launchd 'com.chef.every15' do
action :delete
end
The Examples section demonstrates the different ways to test a launchd resource with ChefSpec.
89 90 91 |
# File 'lib/chefspec/api/launchd.rb', line 89 def delete_launchd(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:launchd, :delete, resource_name) end |
#disable_launchd(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a launchd resource exists in the Chef run with the action :disable. Given a Chef Recipe that disables the launchd daemon “com.chef.every15”:
launchd 'com.chef.every15' do
action :disable
end
The Examples section demonstrates the different ways to test a launchd resource with ChefSpec.
118 119 120 |
# File 'lib/chefspec/api/launchd.rb', line 118 def disable_launchd(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:launchd, :disable, resource_name) end |
#enable_launchd(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a launchd resource exists in the Chef run with the action :enable. Given a Chef Recipe that enables the launchd daemon “com.chef.every15”:
launchd 'com.chef.every15' do
action :enables
end
The Examples section demonstrates the different ways to test a launchd resource with ChefSpec.
147 148 149 |
# File 'lib/chefspec/api/launchd.rb', line 147 def enable_launchd(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:launchd, :enable, resource_name) end |