Module: ChefSpec::API::IfconfigMatchers
- Defined in:
- lib/chefspec/api/ifconfig.rb
Overview
Instance Method Summary collapse
-
#add_ifconfig(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an
ifconfig
resource exists in the Chef run with the action:add
. -
#delete_ifconfig(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an
ifconfig
resource exists in the Chef run with the action:delete
. -
#disable_ifconfig(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an
ifconfig
resource exists in the Chef run with the action:disable
. -
#enable_ifconfig(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an
ifconfig
resource exists in the Chef run with the action:enable
.
Instance Method Details
#add_ifconfig(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an ifconfig
resource exists in the Chef run with the action :add
. Given a Chef Recipe that adds “10.0.0.1” as an ifconfig
:
ifconfig '10.0.0.1' do
action :add
end
The Examples section demonstrates the different ways to test an ifconfig
resource with ChefSpec.
39 40 41 |
# File 'lib/chefspec/api/ifconfig.rb', line 39 def add_ifconfig(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:ifconfig, :add, resource_name) end |
#delete_ifconfig(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an ifconfig
resource exists in the Chef run with the action :delete
. Given a Chef Recipe that deletes “10.0.0.1” as an ifconfig
:
ifconfig '10.0.0.1' do
action :delete
end
The Examples section demonstrates the different ways to test an ifconfig
resource with ChefSpec.
76 77 78 |
# File 'lib/chefspec/api/ifconfig.rb', line 76 def delete_ifconfig(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:ifconfig, :delete, resource_name) end |
#disable_ifconfig(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an ifconfig
resource exists in the Chef run with the action :disable
. Given a Chef Recipe that disables “10.0.0.1” as an ifconfig
:
ifconfig '10.0.0.1' do
action :disable
end
The Examples section demonstrates the different ways to test an ifconfig
resource with ChefSpec.
113 114 115 |
# File 'lib/chefspec/api/ifconfig.rb', line 113 def disable_ifconfig(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:ifconfig, :disable, resource_name) end |
#enable_ifconfig(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an ifconfig
resource exists in the Chef run with the action :enable
. Given a Chef Recipe that enables “10.0.0.1” as an ifconfig
:
ifconfig '10.0.0.1' do
action :enable
end
The Examples section demonstrates the different ways to test an ifconfig
resource with ChefSpec.
150 151 152 |
# File 'lib/chefspec/api/ifconfig.rb', line 150 def enable_ifconfig(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:ifconfig, :enable, resource_name) end |