lostisland/faraday

Add tests and documentation to make sure adapters support streaming requests

iMacTia opened this issue · 2 comments

Issue description

This came out of a recent exchange I had as part of this async-http-faraday issue. Adapters are required to support streaming requests (i.e. IO Stream bodies that respond to #read) to correctly support multipart requests.

This should be correctly spelled out in the documentation and we should also add specs to the "adapter tests" so that external adapters can check if they're compliant or not.

(How do we use adapter tests?)

This is currently supported for RSpec only.
You require 'faraday_specs_setup' in your spec_helper.rb and then call it_behaves_like 'an adapter' from your adapter. You can also optionally turn on some tests for "optional feature" if your adapter supports them.
You can see an example in the template repo.