Module: ChefSpec::API::FreebsdPackageMatchers
- Defined in:
- lib/chefspec/api/freebsd_package.rb
Overview
Instance Method Summary collapse
-
#install_freebsd_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
freebsd_package
resource exists in the Chef run with the action:install
. -
#remove_freebsd_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
freebsd_package
resource exists in the Chef run with the action:remove
.
Instance Method Details
#install_freebsd_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a freebsd_package
resource exists in the Chef run with the action :install
. Given a Chef Recipe that installs “apache2” as a freebsd_package
:
freebsd_package 'apache2' do
action :install
end
The Examples section demonstrates the different ways to test a freebsd_package
resource with ChefSpec.
39 40 41 |
# File 'lib/chefspec/api/freebsd_package.rb', line 39 def install_freebsd_package(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:freebsd_package, :install, resource_name) end |
#remove_freebsd_package(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a freebsd_package
resource exists in the Chef run with the action :remove
. Given a Chef Recipe that removes “apache2” as a freebsd_package
:
freebsd_package 'apache2' do
action :remove
end
The Examples section demonstrates the different ways to test a freebsd_package
resource with ChefSpec.
76 77 78 |
# File 'lib/chefspec/api/freebsd_package.rb', line 76 def remove_freebsd_package(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:freebsd_package, :remove, resource_name) end |