Module: ChefSpec::API::SystemdUnitMatchers
- Defined in:
- lib/chefspec/api/systemd_unit.rb
Overview
Instance Method Summary collapse
-
#create_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
systemd_unitresource exists in the Chef run with the action:create. -
#delete_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
systemd_unitresource exists in the Chef run with the action:delete. -
#disable_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
systemd_unitresource exists in the Chef run with the action:disable. -
#enable_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
systemd_unitresource exists in the Chef run with the action:enable. -
#mask_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
systemd_unitresource exists in the Chef run with the action:mask. -
#reload_or_restart_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
systemd_unitresource exists in the Chef run with the action:reload_or_restart. -
#reload_or_try_restart_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
systemd_unitresource exists in the Chef run with the action:reload_or_try_restart. -
#restart_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
systemd_unitresource exists in the Chef run with the action:restart. -
#start_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
systemd_unitresource exists in the Chef run with the action:start. -
#stop_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
systemd_unitresource exists in the Chef run with the action:stop. -
#try_restart_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
systemd_unitresource exists in the Chef run with the action:try_restart. -
#unmask_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
systemd_unitresource exists in the Chef run with the action:unmask.
Instance Method Details
#create_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a systemd_unit resource exists in the Chef run with the action :create. Given a Chef Recipe that creates the systemd_unit “sysstat-collect.timer”:
systemd_unit 'sysstat-collect.timer' do
action :create
end
The Examples section demonstrates the different ways to test a systemd_unit resource with ChefSpec.
31 32 33 |
# File 'lib/chefspec/api/systemd_unit.rb', line 31 def create_systemd_unit(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:systemd_unit, :create, resource_name) end |
#delete_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a systemd_unit resource exists in the Chef run with the action :delete. Given a Chef Recipe that deletes the systemd_unit “sysstat-collect.timer”:
systemd_unit 'sysstat-collect.timer' do
action :delete
end
The Examples section demonstrates the different ways to test a systemd_unit resource with ChefSpec.
60 61 62 |
# File 'lib/chefspec/api/systemd_unit.rb', line 60 def delete_systemd_unit(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:systemd_unit, :delete, resource_name) end |
#disable_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a systemd_unit resource exists in the Chef run with the action :disable. Given a Chef Recipe that disables the systemd_unit “sysstat-collect.timer”:
systemd_unit 'sysstat-collect.timer' do
action :disable
end
The Examples section demonstrates the different ways to test a systemd_unit resource with ChefSpec.
118 119 120 |
# File 'lib/chefspec/api/systemd_unit.rb', line 118 def disable_systemd_unit(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:systemd_unit, :disable, resource_name) end |
#enable_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a systemd_unit resource exists in the Chef run with the action :enable. Given a Chef Recipe that enables the systemd_unit “sysstat-collect.timer”:
systemd_unit 'sysstat-collect.timer' do
action :enables
end
The Examples section demonstrates the different ways to test a systemd_unit resource with ChefSpec.
89 90 91 |
# File 'lib/chefspec/api/systemd_unit.rb', line 89 def enable_systemd_unit(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:systemd_unit, :enable, resource_name) end |
#mask_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a systemd_unit resource exists in the Chef run with the action :mask. Given a Chef Recipe that masks the systemd_unit “sysstat-collect.timer”:
systemd_unit 'sysstat-collect.timer' do
action :mask
end
The Examples section demonstrates the different ways to test a systemd_unit resource with ChefSpec.
147 148 149 |
# File 'lib/chefspec/api/systemd_unit.rb', line 147 def mask_systemd_unit(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:systemd_unit, :mask, resource_name) end |
#reload_or_restart_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a systemd_unit resource exists in the Chef run with the action :reload_or_restart. Given a Chef Recipe that reloads or restarts the systemd_unit “sysstat-collect.timer”:
systemd_unit 'sysstat-collect.timer' do
action :reload_or_restart
end
The Examples section demonstrates the different ways to test a systemd_unit resource with ChefSpec.
321 322 323 |
# File 'lib/chefspec/api/systemd_unit.rb', line 321 def reload_or_restart_systemd_unit(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:systemd_unit, :reload_or_restart, resource_name) end |
#reload_or_try_restart_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a systemd_unit resource exists in the Chef run with the action :reload_or_try_restart. Given a Chef Recipe that reloads or attempts to restart the systemd_unit “sysstat-collect.timer”:
systemd_unit 'sysstat-collect.timer' do
action :reload_or_try_restart
end
The Examples section demonstrates the different ways to test a systemd_unit resource with ChefSpec.
349 350 351 |
# File 'lib/chefspec/api/systemd_unit.rb', line 349 def reload_or_try_restart_systemd_unit(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:systemd_unit, :reload_or_try_restart, resource_name) end |
#restart_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a systemd_unit resource exists in the Chef run with the action :restart. Given a Chef Recipe that restarts the systemd_unit “sysstat-collect.timer”:
systemd_unit 'sysstat-collect.timer' do
action :restart
end
The Examples section demonstrates the different ways to test a systemd_unit resource with ChefSpec.
263 264 265 |
# File 'lib/chefspec/api/systemd_unit.rb', line 263 def restart_systemd_unit(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:systemd_unit, :restart, resource_name) end |
#start_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a systemd_unit resource exists in the Chef run with the action :start. Given a Chef Recipe that starts the systemd_unit “sysstat-collect.timer”:
systemd_unit 'sysstat-collect.timer' do
action :start
end
The Examples section demonstrates the different ways to test a systemd_unit resource with ChefSpec.
205 206 207 |
# File 'lib/chefspec/api/systemd_unit.rb', line 205 def start_systemd_unit(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:systemd_unit, :start, resource_name) end |
#stop_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a systemd_unit resource exists in the Chef run with the action :stop. Given a Chef Recipe that stops the systemd_unit “sysstat-collect.timer”:
systemd_unit 'sysstat-collect.timer' do
action :stop
end
The Examples section demonstrates the different ways to test a systemd_unit resource with ChefSpec.
234 235 236 |
# File 'lib/chefspec/api/systemd_unit.rb', line 234 def stop_systemd_unit(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:systemd_unit, :stop, resource_name) end |
#try_restart_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a systemd_unit resource exists in the Chef run with the action :try_restart. Given a Chef Recipe that tries to restarts the systemd_unit “sysstat-collect.timer”:
systemd_unit 'sysstat-collect.timer' do
action :try_restart
end
The Examples section demonstrates the different ways to test a systemd_unit resource with ChefSpec.
292 293 294 |
# File 'lib/chefspec/api/systemd_unit.rb', line 292 def try_restart_systemd_unit(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:systemd_unit, :try_restart, resource_name) end |
#unmask_systemd_unit(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a systemd_unit resource exists in the Chef run with the action :unmask. Given a Chef Recipe that masks the systemd_unit “sysstat-collect.timer”:
systemd_unit 'sysstat-collect.timer' do
action :unmask
end
The Examples section demonstrates the different ways to test a systemd_unit resource with ChefSpec.
176 177 178 |
# File 'lib/chefspec/api/systemd_unit.rb', line 176 def unmask_systemd_unit(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:systemd_unit, :unmask, resource_name) end |