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 Ruby 3.4 to CI #1087

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

Conversation

rodrigoargumedo
Copy link
Contributor

@rodrigoargumedo rodrigoargumedo commented Dec 27, 2024

Ruby 3.4 was released on Christmas Day (December 25th, 2024). Merry Christmas to those who celebrate the holiday! 🎄

Ruby 3.4 was released on Christmas Day. Merry Christmas to those who celebrate the holiday! 🎄
@rodrigoargumedo rodrigoargumedo marked this pull request as draft December 27, 2024 15:31
@filipealc
Copy link

filipealc commented Dec 27, 2024

hey @rodrigoargumedo , just saw this PR here, and thanks for opening it for ruby 3.4. For context, trying to run webmock in ruby 3.4 but been getting an error like:

An error occurred while loading spec_helper.
Failure/Error: require 'webmock/rspec'

NameError:
  undefined method 'do_get_block' for class 'WebMockHTTPClient'
# [REDACTED]/.rvm/gems/ruby-3.4.1/gems/webmock-3.24.0/lib/webmock/http_lib_adapters/httpclient_adapter.rb:233:in 'Module#alias_method'
# [REDACTED]/.rvm/gems/ruby-3.4.1/gems/webmock-3.24.0/lib/webmock/http_lib_adapters/httpclient_adapter.rb:233:in '<class:WebMockHTTPClient>'
# [REDACTED]/.rvm/gems/ruby-3.4.1/gems/webmock-3.24.0/lib/webmock/http_lib_adapters/httpclient_adapter.rb:232:in '<top (required)>'
# [REDACTED]/.rvm/gems/ruby-3.4.1/gems/webmock-3.24.0/lib/webmock.rb:52:in 'Kernel#require_relative'
# [REDACTED]/.rvm/gems/ruby-3.4.1/gems/webmock-3.24.0/lib/webmock.rb:52:in '<top (required)>'
# [REDACTED]/.rvm/gems/ruby-3.4.1/gems/webmock-3.24.0/lib/webmock/rspec.rb:3:in '<top (required)>'
# ./spec/spec_helper.rb:4:in '<top (required)>'

from what I can see there's an issue in the class:

class WebMockHTTPClient < HTTPClient
    alias_method :do_get_block_without_webmock, :do_get_block
    alias_method :do_get_stream_without_webmock, :do_get_stream

    include WebMockHTTPClients
  end

Not sure what ruby 3.4 included but seems like the reference to :do_get_block just doesn't work as before (maybe order matters now? for the include)

@rodrigoargumedo
Copy link
Contributor Author

rodrigoargumedo commented Dec 27, 2024

@filipealc Maybe related to this Ruby discussion: it as a default block parameter

Edit:
Shorter version of what's new in 3.4

@filipealc
Copy link

It's my first time interacting with the webmock codebase to be honest, but, looking at the code at httpclient_adapter.rb seems like the issue is more related to how we are importing modules maybe?

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.

2 participants