Module: ChefSpec::API::HttpRequestMatchers
- Defined in:
- lib/chefspec/api/http_request.rb
Overview
Instance Method Summary collapse
-
#delete_http_request(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an
http_requestresource exists in the Chef run with the action:delete. -
#get_http_request(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an
http_requestresource exists in the Chef run with the action:get. -
#head_http_request(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an
http_requestresource exists in the Chef run with the action:head. -
#options_http_request(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an
http_requestresource exists in the Chef run with the action:options. -
#post_http_request(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an
http_requestresource exists in the Chef run with the action:post. -
#put_http_request(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an
http_requestresource exists in the Chef run with the action:put.
Instance Method Details
#delete_http_request(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an http_request resource exists in the Chef run with the action :delete. Given a Chef Recipe that deletes “apache2” as an http_request:
http_request 'apache2' do
action :delete
end
The Examples section demonstrates the different ways to test an http_request resource with ChefSpec.
39 40 41 |
# File 'lib/chefspec/api/http_request.rb', line 39 def delete_http_request(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:http_request, :delete, resource_name) end |
#get_http_request(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an http_request resource exists in the Chef run with the action :get. Given a Chef Recipe that gets “apache2” as an http_request:
http_request 'apache2' do
action :get
end
The Examples section demonstrates the different ways to test an http_request resource with ChefSpec.
76 77 78 |
# File 'lib/chefspec/api/http_request.rb', line 76 def get_http_request(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:http_request, :get, resource_name) end |
#head_http_request(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an http_request resource exists in the Chef run with the action :head. Given a Chef Recipe that heads “apache2” as an http_request:
http_request 'apache2' do
action :head
end
The Examples section demonstrates the different ways to test an http_request resource with ChefSpec.
113 114 115 |
# File 'lib/chefspec/api/http_request.rb', line 113 def head_http_request(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:http_request, :head, resource_name) end |
#options_http_request(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an http_request resource exists in the Chef run with the action :options. Given a Chef Recipe that optionss “apache2” as an http_request:
http_request 'apache2' do
action :options
end
The Examples section demonstrates the different ways to test an http_request resource with ChefSpec.
150 151 152 |
# File 'lib/chefspec/api/http_request.rb', line 150 def (resource_name) ChefSpec::Matchers::ResourceMatcher.new(:http_request, :options, resource_name) end |
#post_http_request(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an http_request resource exists in the Chef run with the action :post. Given a Chef Recipe that posts “apache2” as an http_request:
http_request 'apache2' do
action :post
end
The Examples section demonstrates the different ways to test an http_request resource with ChefSpec.
187 188 189 |
# File 'lib/chefspec/api/http_request.rb', line 187 def post_http_request(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:http_request, :post, resource_name) end |
#put_http_request(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that an http_request resource exists in the Chef run with the action :put. Given a Chef Recipe that puts “apache2” as an http_request:
http_request 'apache2' do
action :put
end
The Examples section demonstrates the different ways to test an http_request resource with ChefSpec.
224 225 226 |
# File 'lib/chefspec/api/http_request.rb', line 224 def put_http_request(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:http_request, :put, resource_name) end |