diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-12-07 11:15:23 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2019-01-03 10:53:48 -0800 |
commit | 10db9b3a50eae9c4c966f39f5beca8f5c17d441e (patch) | |
tree | 596bb3da0bcd1e2fe9a24e3a376fd6223cb6156f /spec/functional | |
parent | 94ba9c022e57feb2949e22656d811a843b3410f1 (diff) | |
download | chef-10db9b3a50eae9c4c966f39f5beca8f5c17d441e.tar.gz |
change HTTPServerException to HTTPClientException for ruby 2.6
includes backcompat for 2.5
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/functional')
-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/) |