diff --git a/test/net/ftp/test_ftp.rb b/test/net/ftp/test_ftp.rb index 6976f11b8f..6f726e1090 100644 --- a/test/net/ftp/test_ftp.rb +++ b/test/net/ftp/test_ftp.rb @@ -2080,6 +2080,8 @@ EOF end def test_abort_tls + return unless defined?(OpenSSL) + commands = [] server = create_ftp_server { |sock| sock.print("220 (test_ftp).\r\n") @@ -2124,6 +2126,8 @@ EOF ftp.abort assert_equal("ABOR\r\n", commands.shift) assert_equal(nil, commands.shift) + rescue RuntimeError, LoadError + # skip (require openssl) ensure ftp.close if ftp end diff --git a/test/net/smtp/test_smtp.rb b/test/net/smtp/test_smtp.rb index 98b7cad345..23e1542d8f 100644 --- a/test/net/smtp/test_smtp.rb +++ b/test/net/smtp/test_smtp.rb @@ -135,6 +135,8 @@ module Net sock.close if sock servers.each(&:close) end + rescue LoadError + # skip (require openssl) end def test_tls_connect_timeout @@ -151,6 +153,8 @@ module Net smtp.start do end end + rescue LoadError + # skip (require openssl) ensure sock.close if sock servers.each(&:close)