From aaeab331841b73da9860f3fa95bfc328706309a5 Mon Sep 17 00:00:00 2001 From: Andy Brody Date: Sun, 5 Jun 2016 20:02:46 -0400 Subject: [PATCH] Fix warnings and accidentally passing test. --- spec/unit/response_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/unit/response_spec.rb b/spec/unit/response_spec.rb index 7e5a039..096c2ab 100644 --- a/spec/unit/response_spec.rb +++ b/spec/unit/response_spec.rb @@ -79,11 +79,12 @@ describe RestClient::Response, :include_helpers do end it "should throw an exception for other codes" do - RestClient::Exceptions::EXCEPTIONS_MAP.each_key do |code| + RestClient::Exceptions::EXCEPTIONS_MAP.each_pair do |code, exc| unless (200..207).include? code net_http_res = response_double(:code => code.to_i) resp = RestClient::Response.create('abc', net_http_res, @request) - expect { resp.return! }.to raise_error + allow(@request).to receive(:max_redirects).and_return(5) + expect { resp.return! }.to raise_error(exc) end end end