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

Remove net-http adapter and update docs #1336

Merged
merged 2 commits into from Oct 25, 2021
Merged

Conversation

iMacTia
Copy link
Member

@iMacTia iMacTia commented Oct 25, 2021

Description

  • Adapt tests to work without net_http adapter
  • Switch Faraday.default_adapter to :test.
  • Update UPGRADING.md and README.md
  • Remove net_http dependency and code references

Todos

List any remaining work that needs to be done, i.e:

  • Tests
  • Documentation

Adapt tests to work without net_http adapter.
Switch `Faraday.default_adapter` to `:test`.
Update UPGRADING.md and README.md
* If you're relying on `Faraday.default_adapter` (e.g. if you use `Faraday.get` or other verb class methods, or not
specifying an adapter in your connection initializer), then you'll now need to set it yourself. It previously
defaulted to `:net_http`, but it now defaults to `:test`.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this section could have a pasteable example of doing what the text says?

Suggested change
Faraday.default_adapter = :net_http

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Well, and some "you could do this" text.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know you could have multi-line code snippets inside list items!!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every day is a school day!

@@ -628,9 +644,16 @@
describe 'request params' do
context 'with simple url' do
let(:url) { 'http://example.com' }
let!(:stubbed) { stub_request(:get, 'http://example.com?a=a&p=3') }
let(:stubs) { Faraday::Adapter::Test::Stubs.new }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sparkling improvement!

Copy link
Member

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Wonderful!

* If you're relying on `Faraday.default_adapter` (e.g. if you use `Faraday.get` or other verb class methods, or not
specifying an adapter in your connection initializer), then you'll now need to set it yourself. It previously
defaulted to `:net_http`, but it now defaults to `:test`.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Well, and some "you could do this" text.)

* If you're relying on `Faraday.default_adapter` (e.g. if you use `Faraday.get` or other verb class methods, or not
specifying an adapter in your connection initializer), then you'll now need to set it yourself. It previously
defaulted to `:net_http`, but it now defaults to `:test`.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every day is a school day!

@iMacTia iMacTia merged commit c010031 into main Oct 25, 2021
@iMacTia iMacTia deleted the remove-net-http-adapter branch October 25, 2021 10:17
jrochkind pushed a commit to jrochkind/faraday that referenced this pull request Dec 20, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants