diff options
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r-- | test/test_helper.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb index ba5ef16..d86f83b 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -28,6 +28,7 @@ require 'tempfile' require 'fileutils' require 'logger' require 'unicorn' +require 'io/nonblock' if ENV['DEBUG'] require 'ruby-debug' @@ -291,3 +292,15 @@ def reset_sig_handlers trap(sig, "DEFAULT") end end + +def tcp_socket(*args) + sock = TCPSocket.new(*args) + sock.nonblock = false + sock +end + +def unix_socket(*args) + sock = UNIXSocket.new(*args) + sock.nonblock = false + sock +end |