Skip to content

Commit 66dc1f6

Browse files
committed
✅ Simplify two DeprecatedClientOptions tests
These tests weren't even using the correct port for the fake server, so there is reason to start it up at all. Also, we have issues with reliably shutting the server down after an error, for both TruffleRuby and JRuby.
1 parent 5550784 commit 66dc1f6

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

test/net/imap/test_deprecated_client_options.rb

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -87,31 +87,15 @@ class InitializeTests < DeprecatedClientOptionsTest
8787
end
8888

8989
test "combined options hash and keyword args raises ArgumentError" do
90-
ex = nil
91-
run_fake_server_in_thread(
92-
ignore_io_error: true, implicit_tls: true
93-
) do |server|
94-
imap = Net::IMAP.new("localhost", {port: 993}, ssl: true)
95-
rescue => ex
96-
nil
97-
ensure
98-
imap&.disconnect
90+
assert_raise_with_message ArgumentError, /deprecated.*keyword arg/ do
91+
Net::IMAP.new("localhost", {port: 993}, ssl: true)
9992
end
100-
assert_equal ArgumentError, ex.class
10193
end
10294

10395
test "combined options hash and ssl args raises ArgumentError" do
104-
ex = nil
105-
run_fake_server_in_thread(
106-
ignore_io_error: true, implicit_tls: true
107-
) do |server|
108-
imap = Net::IMAP.new("localhost", {port: 993}, true)
109-
rescue => ex
110-
nil
111-
ensure
112-
imap&.disconnect
96+
assert_raise_with_message ArgumentError, /deprecated SSL.*options hash/ do
97+
Net::IMAP.new("localhost", {port: 993}, true)
11398
end
114-
assert_equal ArgumentError, ex.class
11599
end
116100

117101
end

0 commit comments

Comments
 (0)