Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions test/lib/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,21 @@ def teardown
end
end

module SimpleTCPServerHelper
private

def start_server
th = Thread.new do
yield
end
@threads << th
sleep 0.001 until th.stop?
end

def create_tcp_server = TCPServer.new(server_addr, 0)
def server_addr = Addrinfo.tcp("localhost", 0).ip_address
end

def wait_for_response_count(imap, type:, count:,
timeout: 0.5, interval: 0.001)
deadline = Time.now + timeout
Expand Down
2 changes: 2 additions & 0 deletions test/net/imap/test_command_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
require "net/imap"
require "test/unit"

# For integration testing of sending of command arguments (over a real socket),
# see test_imap_sending_command_data.rb.
class CommandDataTest < Net::IMAP::TestCase
DataFormatError = Net::IMAP::DataFormatError

Expand Down
Loading
Loading