summaryrefslogtreecommitdiff
path: root/spec/unit/http_spec.rb
diff options
context:
space:
mode:
authordanielsdeleo <dan@getchef.com>2015-03-31 12:45:13 -0700
committerdanielsdeleo <dan@getchef.com>2015-04-01 13:35:01 -0700
commitf066fef19be99ba1b857ecaaabc4c70c9201f1d4 (patch)
tree3b3ef4f4ba872071949814eae60c4267e91b3a65 /spec/unit/http_spec.rb
parentaab0ccb5d41913e050707bd6b40e5b820649c566 (diff)
downloadchef-f066fef19be99ba1b857ecaaabc4c70c9201f1d4.tar.gz
Test base HTTP client behaviors for chefzero URL case
Diffstat (limited to 'spec/unit/http_spec.rb')
-rw-r--r--spec/unit/http_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/unit/http_spec.rb b/spec/unit/http_spec.rb
index ddfc56583d..4d851df951 100644
--- a/spec/unit/http_spec.rb
+++ b/spec/unit/http_spec.rb
@@ -20,6 +20,7 @@ require 'spec_helper'
require 'chef/http'
require 'chef/http/basic_client'
+require 'chef/http/socketless_chef_zero_client'
class Chef::HTTP
public :create_url
@@ -27,6 +28,19 @@ end
describe Chef::HTTP do
+ context "when given a chefzero:// URL" do
+
+ let(:uri) { URI("chefzero://localhost:1") }
+
+ subject(:http) { Chef::HTTP.new(uri) }
+
+ it "uses the SocketlessChefZeroClient to handle requests" do
+ expect(http.http_client).to be_a_kind_of(Chef::HTTP::SocketlessChefZeroClient)
+ expect(http.http_client.url).to eq(uri)
+ end
+
+ end
+
describe "create_url" do
it 'should return a correctly formatted url 1/3 CHEF-5261' do