summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-10-18 13:01:32 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2014-10-18 13:01:32 -0700
commit14bec33882fb239a24bc1972781310eec7b95886 (patch)
tree5b274299a70dbf642fd3985f37379ba163090677
parent9b3e925188a41bbea954429ac81ffdf65e936eda (diff)
downloadchef-14bec33882fb239a24bc1972781310eec7b95886.tar.gz
speed up rest test
eliminate the sleep + retry delays on the other failing test as well
-rw-r--r--spec/unit/rest_spec.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/unit/rest_spec.rb b/spec/unit/rest_spec.rb
index 424fd12ee9..647cd34865 100644
--- a/spec/unit/rest_spec.rb
+++ b/spec/unit/rest_spec.rb
@@ -506,13 +506,17 @@ describe Chef::REST do
http_response.stub(:read_body)
http_response
end
- it "decompresses the JSON error message" do
+
+ before do
rest.stub(:sleep)
rest.stub(:http_retry_count).and_return(0)
+ end
+ it "decompresses the JSON error message" do
expect {rest.request(:GET, url)}.to raise_error(Net::HTTPFatalError)
expect(log_stringio.string).to match(Regexp.escape('INFO: HTTP Request Returned 500 drooling from inside of mouth: Ears get sore!, Not even four'))
end
+
it "fails when the compressed body is truncated" do
http_response["Content-Length"] = (body.bytesize + 99).to_s
expect {rest.request(:GET, url)}.to raise_error(Chef::Exceptions::ContentLengthMismatch)