Creating a new socket is #new, not #connect
This commit is contained in:
@@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user