Patch-Source: https://github.com/ruby/net-ftp/commit/54a9c289048c17e5037ea806e8d7896093f75263 -- From 54a9c289048c17e5037ea806e8d7896093f75263 Mon Sep 17 00:00:00 2001 From: Misaki Shioi Date: Wed, 29 Nov 2023 18:09:39 +0900 Subject: [PATCH] Fall back to SocketError unless Socket::ResolutionError is defined The following PR changes cause Socket::ResolutionError, a subclass of SocketError, to be raised in this test case. https://github.com/ruby/ruby/pull/9018 In this repository, make it fall back to SocketError if it is not defined. --- test/net/ftp/test_ftp.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/net/ftp/test_ftp.rb b/test/net/ftp/test_ftp.rb index a8c3f80..2d60592 100644 --- a/test/net/ftp/test_ftp.rb +++ b/test/net/ftp/test_ftp.rb @@ -2642,7 +2642,9 @@ def test_use_pasv_invalid_ip assert_match(/\AUSER /, commands.shift) assert_match(/\APASS /, commands.shift) assert_equal("TYPE I\r\n", commands.shift) - assert_raise(SocketError) do + + error_klass = defined?(Socket::ResolutionError) ? Socket::ResolutionError : SocketError + assert_raise(error_klass) do ftp.getbinaryfile("foo", nil) end ensure