Creating a new socket is #new, not #connect

This commit is contained in:
Nick Thomas
2011-11-13 18:43:43 +00:00
parent 51175ddf56
commit 875820f011
2 changed files with 4 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ module TestQMPClient
cargs = ["127.0.0.1", 4440, "127.0.0.1", 40000]
mock_sock = mock("(tcp-socket)")
mock_sock.stubs(:closed? => false, :close => true)
TCPSocket.expects(:connect).with(*cargs).once.returns(mock_sock)
TCPSocket.expects(:new).with(*cargs).once.returns(mock_sock)
expects_socket_run(mock_sock)
runs_api_block = false
@@ -44,7 +44,7 @@ module TestQMPClient
def test_connect_unix
mock_sock = mock("(unix-socket)")
mock_sock.stubs(:closed? => false, :close => true)
UNIXSocket.expects(:connect).with("/tmp/test.sock").once.returns(mock_sock)
UNIXSocket.expects(:new).with("/tmp/test.sock").once.returns(mock_sock)
expects_socket_run(mock_sock)