Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests and documentation to make sure adapters support streaming requests #1554

Open
iMacTia opened this issue Feb 8, 2024 · 2 comments

Comments

@iMacTia
Copy link
Member

iMacTia commented Feb 8, 2024

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.

@ioquatix
Copy link
Contributor

ioquatix commented Feb 8, 2024

(How do we use adapter tests?)

@iMacTia
Copy link
Member Author

iMacTia commented Feb 8, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants