Module: ChefSpec::API::ChocolateyPackageMatchers
- Defined in:
- lib/chefspec/api/chocolatey_package.rb
Overview
Instance Method Summary collapse
-
#install_chocolatey_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
chocolatey_packageresource exists in the Chef run with the action:install. -
#remove_chocolatey_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
chocolatey_packageresource exists in the Chef run with the action:remove. -
#upgrade_chocolatey_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
chocolatey_packageresource exists in the Chef run with the action:upgrade.
Instance Method Details
#install_chocolatey_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a chocolatey_package resource exists in the Chef run with the action :install. Given a Chef Recipe that installs “7zip” as a chocolatey_package:
chocolatey_package '7zip' do
action :install
end
The Examples section demonstrates the different ways to test a chocolatey_package resource with ChefSpec.
)
34 35 36 |
# File 'lib/chefspec/api/chocolatey_package.rb', line 34 def install_chocolatey_package(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:chocolatey_package, :install, resource_name) end |
#remove_chocolatey_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a chocolatey_package resource exists in the Chef run with the action :remove. Given a Chef Recipe that removes “7zip” as a chocolatey_package:
chocolatey_package '7zip' do
action :remove
end
To test the content rendered by a chocolatey_package, see RenderFileMatchers.
The Examples section demonstrates the different ways to test a chocolatey_package resource with ChefSpec.
70 71 72 |
# File 'lib/chefspec/api/chocolatey_package.rb', line 70 def remove_chocolatey_package(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:chocolatey_package, :remove, resource_name) end |
#upgrade_chocolatey_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a chocolatey_package resource exists in the Chef run with the action :upgrade. Given a Chef Recipe that upgrades “7zip” as a chocolatey_package:
chocolatey_package '7zip' do
action :upgrade
end
The Examples section demonstrates the different ways to test a chocolatey_package resource with ChefSpec.
)
103 104 105 |
# File 'lib/chefspec/api/chocolatey_package.rb', line 103 def upgrade_chocolatey_package(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:chocolatey_package, :upgrade, resource_name) end |