summaryrefslogtreecommitdiff
path: root/spec/functional
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-12-07 11:15:23 -0800
committerTim Smith <tsmith@chef.io>2019-01-16 10:36:58 -0800
commitf019096eb5916a79af3f5a8ac8e3f1816f1589fb (patch)
tree7a7b0e214084fc368332e9363b3bf29aaea59d8f /spec/functional
parent235454432d9cb430b50f7cd728d12f756c15e263 (diff)
downloadchef-f019096eb5916a79af3f5a8ac8e3f1816f1589fb.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.rb20
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/)