lostisland / faraday

Simple, but flexible HTTP client library, with support for multiple backends.
https://lostisland.github.io/faraday
MIT License
5.76k stars 981 forks source link

Fix compatibility with Ruby 3.4.0-preview1 #1560

Closed m-nakamura145 closed 6 months ago

m-nakamura145 commented 6 months ago

Description

This PR deals with Ruby 3.4's backtrace incompatibility introduced at https://github.com/ruby/ruby/pull/9608. https://bugs.ruby-lang.org/issues/16495

❯ ruby -v
ruby 3.4.0preview1 (2024-05-16 master 9d69619623) [x86_64-darwin23]

  1) Faraday proxies to default_connection uses method_missing on Faraday if there is no proxyable method
     Failure/Error: expect { Faraday.this_method_does_not_exist }.to raise_error(NoMethodError, expected_message)

       expected NoMethodError with "undefined method `this_method_does_not_exist' for module Faraday", got #<NoMethodError: undefined method 'this_method_does_not_exist' for module Faraday> with backtrace:
         # ./lib/faraday.rb:147:in 'Faraday.method_missing'
         # ./spec/faraday_spec.rb:28:in 'block (4 levels) in <top (required)>'
         # ./spec/faraday_spec.rb:28:in 'block (3 levels) in <top (required)>'
     # ./spec/faraday_spec.rb:28:in 'block (3 levels) in <top (required)>'

Todos

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

Additional Notes

Optional section

iMacTia commented 6 months ago

I'm not entirely sure how this test didn't fail sooner in main against ruby-head, but since it's passing fine here, I think there's no problem to get this merged 😄 Thanks 🙇 !