Module: ChefSpec::API::GemPackageMatchers
- Defined in:
- lib/chefspec/api/gem_package.rb
Overview
Instance Method Summary collapse
-
#install_gem_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
gem_package
resource exists in the Chef run with the action:install
. -
#purge_gem_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
gem_package
resource exists in the Chef run with the action:purge
. -
#reconfig_gem_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
gem_package
resource exists in the Chef run with the action:reconfig
. -
#remove_gem_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
gem_package
resource exists in the Chef run with the action:remove
. -
#upgrade_gem_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
gem_package
resource exists in the Chef run with the action:upgrade
.
Instance Method Details
#install_gem_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a gem_package
resource exists in the Chef run with the action :install
. Given a Chef Recipe that installs “community-zero” as a gem_package
:
gem_package 'community-zero' do
action :install
end
The Examples section demonstrates the different ways to test a gem_package
resource with ChefSpec.
39 40 41 |
# File 'lib/chefspec/api/gem_package.rb', line 39 def install_gem_package(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:gem_package, :install, resource_name) end |
#purge_gem_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a gem_package
resource exists in the Chef run with the action :purge
. Given a Chef Recipe that purges “community-zero” as a gem_package
:
gem_package 'community-zero' do
action :purge
end
The Examples section demonstrates the different ways to test a gem_package
resource with ChefSpec.
76 77 78 |
# File 'lib/chefspec/api/gem_package.rb', line 76 def purge_gem_package(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:gem_package, :purge, resource_name) end |
#reconfig_gem_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a gem_package
resource exists in the Chef run with the action :reconfig
. Given a Chef Recipe that reconfigures “community-zero” as a gem_package
:
gem_package 'community-zero' do
action :reconfig
end
The Examples section demonstrates the different ways to test a gem_package
resource with ChefSpec.
113 114 115 |
# File 'lib/chefspec/api/gem_package.rb', line 113 def reconfig_gem_package(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:gem_package, :reconfig, resource_name) end |
#remove_gem_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a gem_package
resource exists in the Chef run with the action :remove
. Given a Chef Recipe that removes “community-zero” as a gem_package
:
gem_package 'community-zero' do
action :remove
end
The Examples section demonstrates the different ways to test a gem_package
resource with ChefSpec.
150 151 152 |
# File 'lib/chefspec/api/gem_package.rb', line 150 def remove_gem_package(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:gem_package, :remove, resource_name) end |
#upgrade_gem_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a gem_package
resource exists in the Chef run with the action :upgrade
. Given a Chef Recipe that upgrades “community-zero” as a gem_package
:
gem_package 'community-zero' do
action :upgrade
end
The Examples section demonstrates the different ways to test a gem_package
resource with ChefSpec.
187 188 189 |
# File 'lib/chefspec/api/gem_package.rb', line 187 def upgrade_gem_package(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:gem_package, :upgrade, resource_name) end |