Module: ChefSpec::API::AptRepositoryMatchers
- Defined in:
- lib/chefspec/api/apt_repository.rb
Overview
Instance Method Summary collapse
-
#add_apt_repository(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an
apt_repositoryresource exists in the Chef run with the action:add. -
#remove_apt_repository(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an
apt_repositoryresource exists in the Chef run with the action:remove.
Instance Method Details
#add_apt_repository(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an apt_repository resource exists in the Chef run with the action :add. Given a Chef Recipe that adds “rsyslog” as an apt_repository:
apt_repository 'rsyslog' do
uri 'ppa:adiscon/v8-stable'
action :add
end
The Examples section demonstrates the different ways to test an apt_repository resource with ChefSpec.
26 27 28 29 |
# File 'lib/chefspec/api/apt_repository.rb', line 26 def add_apt_repository(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:apt_repository, :add, resource_name) end |
#remove_apt_repository(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an apt_repository resource exists in the Chef run with the action :remove. Given a Chef Recipe that removes “rsyslog” as an apt_repository:
apt_repository 'rsyslog' do
uri 'ppa:adiscon/v8-stable'
action :remove
end
The Examples section demonstrates the different ways to test an apt_repository resource with ChefSpec.
51 52 53 54 |
# File 'lib/chefspec/api/apt_repository.rb', line 51 def remove_apt_repository(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:apt_repository, :remove, resource_name) end |