Module: ChefSpec::API::WindowsPackageMatchers
- Defined in:
- lib/chefspec/api/windows_package.rb
Overview
Instance Method Summary collapse
-
#install_windows_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
windows_packageresource exists in the Chef run with the action:install. -
#remove_windows_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
windows_packageresource exists in the Chef run with the action:remove.
Instance Method Details
#install_windows_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a windows_package resource exists in the Chef run with the action :install. Given a Chef Recipe that installs “7zip” as a windows_package:
windows_package '7zip' do
action :install
end
To test the content rendered by a windows_package, see RenderFileMatchers.
The Examples section demonstrates the different ways to test a windows_package resource with ChefSpec.
42 43 44 |
# File 'lib/chefspec/api/windows_package.rb', line 42 def install_windows_package(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:windows_package, :install, resource_name) end |
#remove_windows_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a windows_package resource exists in the Chef run with the action :remove. Given a Chef Recipe that removes “7zip” as a windows_package:
windows_package '7zip' do
action :remove
end
To test the content rendered by a windows_package, see RenderFileMatchers.
The Examples section demonstrates the different ways to test a windows_package resource with ChefSpec.
82 83 84 |
# File 'lib/chefspec/api/windows_package.rb', line 82 def remove_windows_package(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:windows_package, :remove, resource_name) end |