artifice-excon 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/artifice/excon.rb +7 -1
- metadata +1 -1
data/lib/artifice/excon.rb
CHANGED
@@ -93,8 +93,14 @@ module Artifice
|
|
93
93
|
response = rack_request.request(request,
|
94
94
|
{ :method => params[:method], :input => params[:body] })
|
95
95
|
|
96
|
-
::Excon::Response.new(:body => response.body,
|
96
|
+
response = ::Excon::Response.new(:body => response.body,
|
97
97
|
:headers => response.headers, :status => response.status)
|
98
|
+
|
99
|
+
if params.has_key?(:expects) && ![*params[:expects]].include?(response.status)
|
100
|
+
raise(::Excon::Errors.status_error(params, response))
|
101
|
+
end
|
102
|
+
|
103
|
+
response
|
98
104
|
end
|
99
105
|
|
100
106
|
private
|