test/test_client.rb in mosquitto-0.2 vs test/test_client.rb in mosquitto-0.3
- old
+ new
@@ -48,48 +48,48 @@
def test_connect
client = Mosquitto::Client.new
assert client.loop_start
assert_raises TypeError do
- client.connect(:invalid, TEST_PORT, 10)
+ client.connect(:invalid, TEST_PORT, TIMEOUT)
end
- assert client.connect(TEST_HOST, TEST_PORT, 10)
+ assert client.connect(TEST_HOST, TEST_PORT, TIMEOUT)
ensure
client.loop_stop(true)
end
def test_connect_bind
client = Mosquitto::Client.new
assert client.loop_start
assert_raises TypeError do
- client.connect_bind("localhost", TEST_PORT, 10, :invalid)
+ client.connect_bind("localhost", TEST_PORT, TIMEOUT, :invalid)
end
- assert client.connect_bind(TEST_HOST, TEST_PORT, 10, "0.0.0.0")
+ assert client.connect_bind(TEST_HOST, TEST_PORT, TIMEOUT, "0.0.0.0")
ensure
client.loop_stop(true)
end
def test_connect_async
client = Mosquitto::Client.new
assert client.loop_start
assert_raises TypeError do
- client.connect_async(:invalid, TEST_PORT, 10)
+ client.connect_async(:invalid, TEST_PORT, TIMEOUT)
end
- assert client.connect_async(TEST_HOST, TEST_PORT, 10)
+ assert client.connect_async(TEST_HOST, TEST_PORT, TIMEOUT)
client.wait_readable
assert client.socket != -1
ensure
client.loop_stop(true)
end
def test_connect_bind_async
client = Mosquitto::Client.new
assert client.loop_start
assert_raises TypeError do
- client.connect_bind_async(TEST_HOST, TEST_PORT, 10, :invalid)
+ client.connect_bind_async(TEST_HOST, TEST_PORT, TIMEOUT, :invalid)
end
- assert client.connect_bind_async(TEST_HOST, TEST_PORT, 10, '0.0.0.0')
+ assert client.connect_bind_async(TEST_HOST, TEST_PORT, TIMEOUT, '0.0.0.0')
client.wait_readable
assert client.socket != -1
ensure
client.loop_stop(true)
end
@@ -98,21 +98,23 @@
client = Mosquitto::Client.new
assert client.loop_start
assert_raises Mosquitto::Error do
client.disconnect
end
- assert client.connect(TEST_HOST, TEST_PORT, 10)
+ assert client.connect(TEST_HOST, TEST_PORT, TIMEOUT)
+ client.wait_readable
assert client.disconnect
ensure
client.loop_stop(true)
end
def test_reconnect
client = Mosquitto::Client.new
assert_raises Mosquitto::Error do
client.reconnect
end
- assert client.connect(TEST_HOST, TEST_PORT, 10)
+ assert client.connect(TEST_HOST, TEST_PORT, TIMEOUT)
+ client.wait_readable
assert client.reconnect
end
def test_reconnect_delay_set
client = Mosquitto::Client.new
\ No newline at end of file