artifice-excon 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/artifice/excon.rb +7 -1
  2. metadata +1 -1
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: artifice-excon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: