diff options
Diffstat (limited to 'spec/functional/http/simple_spec.rb')
-rw-r--r-- | spec/functional/http/simple_spec.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/functional/http/simple_spec.rb b/spec/functional/http/simple_spec.rb index e835bb0c79..313fed064b 100644 --- a/spec/functional/http/simple_spec.rb +++ b/spec/functional/http/simple_spec.rb @@ -61,27 +61,27 @@ describe Chef::HTTP::Simple do end shared_examples_for "an endpoint that 403s" do - it "fails with a Net::HTTPServerException for a streaming request" do - expect { http_client.streaming_request(source) }.to raise_error(Net::HTTPServerException) + it "fails with a Net::HTTPClientException for a streaming request" do + expect { http_client.streaming_request(source) }.to raise_error(Net::HTTPClientException) end - it "fails with a Net::HTTPServerException for a GET request" do - expect { http_client.get(source) }.to raise_error(Net::HTTPServerException) + it "fails with a Net::HTTPClientException for a GET request" do + expect { http_client.get(source) }.to raise_error(Net::HTTPClientException) end end # see CHEF-5100 shared_examples_for "a 403 after a successful request when reusing the request object" do - it "fails with a Net::HTTPServerException for a streaming request" do + it "fails with a Net::HTTPClientException for a streaming request" do tempfile = http_client.streaming_request(source) tempfile.close expect(Digest::MD5.hexdigest(binread(tempfile.path))).to eq(Digest::MD5.hexdigest(expected_content)) - expect { http_client.streaming_request(source2) }.to raise_error(Net::HTTPServerException) + expect { http_client.streaming_request(source2) }.to raise_error(Net::HTTPClientException) end - it "fails with a Net::HTTPServerException for a GET request" do + it "fails with a Net::HTTPClientException for a GET request" do expect(Digest::MD5.hexdigest(http_client.get(source))).to eq(Digest::MD5.hexdigest(expected_content)) - expect { http_client.get(source2) }.to raise_error(Net::HTTPServerException) + expect { http_client.get(source2) }.to raise_error(Net::HTTPClientException) end end @@ -120,7 +120,7 @@ describe Chef::HTTP::Simple do it "Logs the request and response and bodies for 400 response" do expect do http_client.get("http://localhost:9000/bad_request") - end.to raise_error(Net::HTTPServerException) + end.to raise_error(Net::HTTPClientException) expect(@debug_log).to match(/400/) expect(@debug_log).to match(/HTTP Request Header Data/) expect(@debug_log).to match(/HTTP Status and Header Data/) @@ -133,7 +133,7 @@ describe Chef::HTTP::Simple do it "Logs the request and response and bodies for 400 POST response" do expect do http_client.post("http://localhost:9000/bad_request", "hithere") - end.to raise_error(Net::HTTPServerException) + end.to raise_error(Net::HTTPClientException) expect(@debug_log).to match(/400/) expect(@debug_log).to match(/HTTP Request Header Data/) expect(@debug_log).to match(/HTTP Status and Header Data/) |