Skip to content

Commit

Permalink
Omit test_imaps_verify_none if it catched OpenSSL::SSL::SSLError and …
Browse files Browse the repository at this point in the history
…running with macOS
  • Loading branch information
hsbt committed Jan 30, 2025
1 parent 8850cf4 commit b5d4c35
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions test/net/imap/test_imap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def test_imaps_with_ca_file
ssl: { :ca_file => CA_FILE })
verified = imap.tls_verified?
imap
rescue OpenSSL::SSL::SSLError => e
raise e unless /darwin/ =~ RUBY_PLATFORM
rescue SystemCallError
skip $!
end
Expand All @@ -69,14 +71,18 @@ def test_imaps_verify_none
# Otherwise, failures can't logout and need to wait for the timeout.
verified, imap = :unknown, nil
assert_nothing_raised do
imaps_test do |port|
imap = Net::IMAP.new(
server_addr,
port: port,
ssl: { :verify_mode => OpenSSL::SSL::VERIFY_NONE }
)
verified = imap.tls_verified?
imap
begin
imaps_test do |port|
imap = Net::IMAP.new(
server_addr,
port: port,
ssl: { :verify_mode => OpenSSL::SSL::VERIFY_NONE }
)
verified = imap.tls_verified?
imap
end
rescue OpenSSL::SSL::SSLError => e
raise e unless /darwin/ =~ RUBY_PLATFORM
end
end
assert_equal false, verified
Expand Down

0 comments on commit b5d4c35

Please sign in to comment.