summaryrefslogtreecommitdiff
path: root/test/net/smtp/test_starttls.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/net/smtp/test_starttls.rb')
-rw-r--r--test/net/smtp/test_starttls.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/net/smtp/test_starttls.rb b/test/net/smtp/test_starttls.rb
index 2c812aea67..a0855b915e 100644
--- a/test/net/smtp/test_starttls.rb
+++ b/test/net/smtp/test_starttls.rb
@@ -25,7 +25,8 @@ module Net
end
def start_smtpd(starttls)
- @server_socket, @client_socket = UNIXSocket.pair
+ @server_socket, @client_socket = Object.const_defined?(:UNIXSocket) ?
+ UNIXSocket.pair : Socket.pair(:INET, :STREAM, 0)
@starttls_executed = false
@server_thread = Thread.new(@server_socket) do |s|
s.puts "220 fakeserver\r\n"
@@ -118,4 +119,4 @@ module Net
assert_nothing_raised { smtp.enable_starttls_auto }
end
end
-end unless /mswin|mingw/ =~ RUBY_PLATFORM
+end