145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
# File 'lib/faraday/adapter/test.rb', line 145
def call(env)
super
normalized_path = Faraday::Utils.normalize_path(env[:url])
if stub = stubs.match(env[:method], normalized_path, env[:body])
env[:params] = (query = env[:url].query) ?
Faraday::Utils.parse_nested_query(query) :
{}
status, , body = stub.block.call(env)
save_response(env, status, body, )
else
raise Stubs::NotFound, "no stubbed request for #{env[:method]} #{normalized_path} #{env[:body]}"
end
@app.call(env)
end
|