Module: ChefSpec::API::YumRepositoryMatchers
- Defined in:
- lib/chefspec/api/yum_repository.rb
Overview
Instance Method Summary collapse
-
#add_yum_repository(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
yum_repositoryresource exists in the Chef run with the action:add. -
#create_yum_repository(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
yum_repositoryresource exists in the Chef run with the action:create. -
#delete_yum_repository(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
yum_repositoryresource exists in the Chef run with the action:delete. -
#makecache_yum_repository(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
yum_repositoryresource exists in the Chef run with the action:makecache. -
#remove_yum_repository(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
yum_repositoryresource exists in the Chef run with the action:remove.
Instance Method Details
#add_yum_repository(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a yum_repository resource exists in the Chef run with the action :add. Given a Chef Recipe that adds “epel” as an yum_repository:
yum_repository 'epel' do
baseurl "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-#{node['platform_version'].to_i}&arch=$basearch"
description 'Extra Packages for $releasever - $basearch'
action :add
end
The Examples section demonstrates the different ways to test an yum_repository resource with ChefSpec.
53 54 55 56 |
# File 'lib/chefspec/api/yum_repository.rb', line 53 def add_yum_repository(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:yum_repository, :add, resource_name) end |
#create_yum_repository(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a yum_repository resource exists in the Chef run with the action :create. Given a Chef Recipe that creates “epel” as an yum_repository:
yum_repository 'epel' do
baseurl "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-#{node['platform_version'].to_i}&arch=$basearch"
description 'Extra Packages for $releasever - $basearch'
action :create
end
The Examples section demonstrates the different ways to test an yum_repository resource with ChefSpec.
27 28 29 30 |
# File 'lib/chefspec/api/yum_repository.rb', line 27 def create_yum_repository(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:yum_repository, :create, resource_name) end |
#delete_yum_repository(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a yum_repository resource exists in the Chef run with the action :delete. Given a Chef Recipe that deletes “epel” as an yum_repository:
yum_repository 'epel' do
action :delete
end
The Examples section demonstrates the different ways to test an yum_repository resource with ChefSpec.
77 78 79 80 |
# File 'lib/chefspec/api/yum_repository.rb', line 77 def delete_yum_repository(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:yum_repository, :delete, resource_name) end |
#makecache_yum_repository(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a yum_repository resource exists in the Chef run with the action :makecache. Given a Chef Recipe that makes cache for “epel” as a yum_repository:
yum_repository 'epel' do
action :makecache
end
The Examples section demonstrates the different ways to test an yum_repository resource with ChefSpec.
125 126 127 128 |
# File 'lib/chefspec/api/yum_repository.rb', line 125 def makecache_yum_repository(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:yum_repository, :makecache, resource_name) end |
#remove_yum_repository(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a yum_repository resource exists in the Chef run with the action :remove. Given a Chef Recipe that removes “epel” as an yum_repository:
yum_repository 'epel' do
action :remove
end
The Examples section demonstrates the different ways to test an yum_repository resource with ChefSpec.
101 102 103 104 |
# File 'lib/chefspec/api/yum_repository.rb', line 101 def remove_yum_repository(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:yum_repository, :remove, resource_name) end |