Skip to content

Commit

Permalink
Handle Errno::ECONNABORTED on Windows platform
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Nov 29, 2024
1 parent 265823a commit adb13f3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/net/smtp/test_smtp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,8 @@ def test_start_with_starttls_false
end

def test_start_auth_plain
omit "This test is not supported on Windows" if /mswin|mingw/ =~ RUBY_PLATFORM

port = fake_server_start(auth: 'plain')
Net::SMTP.start('localhost', port, user: 'account', password: 'password', authtype: :plain){}

Expand All @@ -482,6 +484,8 @@ def test_start_auth_plain
end

def test_start_auth_login
omit "This test is not supported on Windows" if /mswin|mingw/ =~ RUBY_PLATFORM

port = fake_server_start(auth: 'LOGIN')
Net::SMTP.start('localhost', port, user: 'account', password: 'password', authtype: :login){}

Expand Down Expand Up @@ -789,7 +793,7 @@ def loop
@sock.puts "502 5.5.2 Error: command not recognized\r\n"
end
end
rescue Errno::ECONNRESET
rescue Errno::ECONNRESET, Errno::ECONNABORTED
nil
end
end
Expand Down

0 comments on commit adb13f3

Please sign in to comment.