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

Fix failing tests on Ruby 3.4 because of hash inspect changes #1074

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Earlopain
Copy link
Contributor

Ruby has changed the output of Hash.inspect, causing some test failures.

Instead of hardcoding it, just call inspect itself to pass tests on old and new rubies

Ref:

Note that I still have some failing tests like this:

1) Excon with WebMock when after_request callback is declared should invoke callbacks only for real requests if requested
     Failure/Error: response = Excon.new(uri, excon_options.merge(nonblock: false)).request(options, &block)
     
     Excon::Error::Socket:
       undefined method 'casecmp' for nil (NoMethodError)
     Shared Example Group: "callbacks" called from ./spec/acceptance/webmock_shared.rb:43
     Shared Example Group: "with WebMock" called from ./spec/acceptance/excon/excon_spec.rb:7
     # ./spec/acceptance/excon/excon_spec_helper.rb:22:in 'ExconSpecHelper#http_request'
     # ./spec/acceptance/shared/callbacks.rb:136:in 'block (3 levels) in <top (required)>'
     # ./spec/acceptance/webmock_shared.rb:26:in 'block (3 levels) in <top (required)>'
     # ./lib/webmock/rspec.rb:39:in 'block (2 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # NoMethodError:
     #   undefined method 'casecmp' for nil
     #   ./spec/acceptance/excon/excon_spec_helper.rb:22:in 'ExconSpecHelper#http_request'

Finished in 0.67789 seconds (files took 0.81427 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/acceptance/excon/excon_spec.rb[1:1:10:9] # Excon with WebMock when after_request callback is declared should invoke callbacks only for real requests if requested

I have not looked into those yet. I did notice that excon very recently released 1.0.0, maybe it's related to that.

Ruby has changed the output of `Hash.inspect`, causing some test failures.

Instead of hardcoding it, just call inspect itself to pass tests on old and new rubies

Ref:
* ruby/ruby#10924
* https://bugs.ruby-lang.org/issues/20433
@Earlopain
Copy link
Contributor Author

Earlopain commented Oct 28, 2024

Created an upstream issue for excon excon/excon#862 / excon/excon#863

@Earlopain
Copy link
Contributor Author

Can someone with a bit more knowledge chime in at excon/excon#863? I'm not qualified for that and it's a bit more complicated than I thought

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.

1 participant