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

Exclude em-http-request on Ruby 3.4 #1070

Merged
merged 4 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/webmock/http_lib_adapters/em_http_request_adapter.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

return if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4.0')

begin
require 'em-http-request'
rescue LoadError
Expand Down
4 changes: 4 additions & 0 deletions spec/acceptance/em_http_request/em_http_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
describe "EM::HttpRequest" do
include EMHttpRequestSpecHelper

before(:all) do
skip 'em-http-request is not supported on Ruby >= 3.4' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.4.0')
end

include_context "with WebMock", :no_status_message

#functionality only supported for em-http-request 1.x
Expand Down
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
unless RUBY_PLATFORM =~ /java/
require 'curb'
require 'patron'
require 'em-http'
Copy link
Owner

Choose a reason for hiding this comment

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

@c960657 why is it important to remove that require?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On Ruby HEAD, even require'ing the library will raise because of the missing constant. Removing it here doesn't seem to affect the tests on the other Ruby versions AFAICT.

Copy link
Owner

Choose a reason for hiding this comment

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

@c960657 thank you for investigating that and explaining 👍

require 'typhoeus'
end
if RUBY_PLATFORM =~ /java/
Expand Down
Loading