Module: ChefSpec::API::AptUpdateMatchers
- Defined in:
- lib/chefspec/api/apt_update.rb
Overview
Instance Method Summary collapse
-
#periodic_apt_update(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an
apt_updateresource exists in the Chef run with the action:periodic. -
#update_apt_update(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an
apt_updateresource exists in the Chef run with the action:update.
Instance Method Details
#periodic_apt_update(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an apt_update resource exists in the Chef run with the action :periodic. Given a Chef Recipe that updates “rsyslog” as an apt_update: periodically
apt_update 'rsyslog' do
action :periodic
end
The Examples section demonstrates the different ways to test an apt_update resource with ChefSpec.
48 49 50 51 |
# File 'lib/chefspec/api/apt_update.rb', line 48 def periodic_apt_update(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:apt_update, :periodic, resource_name) end |
#update_apt_update(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an apt_update resource exists in the Chef run with the action :update. Given a Chef Recipe that adds “rsyslog” as a repository to update.
apt_repository 'rsyslog' do
action :update
end
The Examples section demonstrates the different ways to test an apt_update resource with ChefSpec.
24 25 26 27 |
# File 'lib/chefspec/api/apt_update.rb', line 24 def update_apt_update(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:apt_update, :update, resource_name) end |