Module: ChefSpec::API::RouteMatchers
- Defined in:
- lib/chefspec/api/route.rb
Overview
Instance Method Summary collapse
-
#add_route(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
route
resource exists in the Chef run with the action:add
. -
#delete_route(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
route
resource exists in the Chef run with the action:delete
.
Instance Method Details
#add_route(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a route
resource exists in the Chef run with the action :add
. Given a Chef Recipe that adds “10.0.0.10/32” as a route
:
route '10.0.0.10/32' do
action :add
end
The Examples section demonstrates the different ways to test a route
resource with ChefSpec.
39 40 41 |
# File 'lib/chefspec/api/route.rb', line 39 def add_route(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:route, :add, resource_name) end |
#delete_route(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a route
resource exists in the Chef run with the action :delete
. Given a Chef Recipe that deletes “10.0.0.10/32” as a route
:
route '10.0.0.10/32' do
action :delete
end
The Examples section demonstrates the different ways to test a route
resource with ChefSpec.
76 77 78 |
# File 'lib/chefspec/api/route.rb', line 76 def delete_route(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:route, :delete, resource_name) end |