diff options
author | danielsdeleo <dan@opscode.com> | 2013-10-04 17:27:51 -0700 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2013-10-08 15:01:48 -0700 |
commit | 3b169bddbc3ba5c9759e01a6438d70e34d264cf0 (patch) | |
tree | ace89ef2cd976409ddaef3390df4fcc33db28f5b /spec | |
parent | 9a98be5ad08813d532694f95c480b0bcbecd0da6 (diff) | |
download | chef-3b169bddbc3ba5c9759e01a6438d70e34d264cf0.tar.gz |
HTTP client creates request objects.
Changes the structure of HTTP requests so that we create an HTTP client
object and then ask it to make requests. This allows for easier
customization of the HTTP client object, in particular enabling use to
make use of persistent connections.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/rest/auth_credentials_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/unit/rest/auth_credentials_spec.rb b/spec/unit/rest/auth_credentials_spec.rb index de06b2cc55..f34150ee79 100644 --- a/spec/unit/rest/auth_credentials_spec.rb +++ b/spec/unit/rest/auth_credentials_spec.rb @@ -232,7 +232,7 @@ describe Chef::REST::RESTRequest do it "raises a ConfigurationError if :ssl_ca_path is set to a path that doesn't exist" do Chef::Config[:ssl_ca_path] = "/dev/null/nothing_here" - lambda {new_request}.should raise_error(Chef::Exceptions::ConfigurationError) + lambda {new_request.http_client}.should raise_error(Chef::Exceptions::ConfigurationError) end it "should set the CA path if that is set in the configuration" do @@ -242,7 +242,7 @@ describe Chef::REST::RESTRequest do it "raises a ConfigurationError if :ssl_ca_file is set to a file that does not exist" do Chef::Config[:ssl_ca_file] = "/dev/null/nothing_here" - lambda {new_request}.should raise_error(Chef::Exceptions::ConfigurationError) + lambda {new_request.http_client}.should raise_error(Chef::Exceptions::ConfigurationError) end it "should set the CA file if that is set in the configuration" do @@ -268,19 +268,19 @@ describe Chef::REST::RESTRequest do it "raises ConfigurationError if the certificate file doesn't exist" do Chef::Config[:ssl_client_cert] = "/dev/null/nothing_here" Chef::Config[:ssl_client_key] = CHEF_SPEC_DATA + '/ssl/chef-rspec.key' - lambda {new_request}.should raise_error(Chef::Exceptions::ConfigurationError) + lambda {new_request.http_client}.should raise_error(Chef::Exceptions::ConfigurationError) end it "raises ConfigurationError if the certificate file doesn't exist" do Chef::Config[:ssl_client_cert] = CHEF_SPEC_DATA + '/ssl/chef-rspec.cert' Chef::Config[:ssl_client_key] = "/dev/null/nothing_here" - lambda {new_request}.should raise_error(Chef::Exceptions::ConfigurationError) + lambda {new_request.http_client}.should raise_error(Chef::Exceptions::ConfigurationError) end it "raises a ConfigurationError if one of :ssl_client_cert and :ssl_client_key is set but not both" do Chef::Config[:ssl_client_cert] = "/dev/null/nothing_here" Chef::Config[:ssl_client_key] = nil - lambda {new_request}.should raise_error(Chef::Exceptions::ConfigurationError) + lambda {new_request.http_client}.should raise_error(Chef::Exceptions::ConfigurationError) end it "configures the HTTP client's cert and private key" do |