test/proxymachine_test.rb in fizx-proxymachine-1.7.1 vs test/proxymachine_test.rb in fizx-proxymachine-1.8.0
- old
+ new
@@ -39,10 +39,14 @@
should "handle data plus reply" do
assert_proxy('localhost', 9990, 'g', 'g3-9980:g2')
end
+ should "handle delayed routes" do
+ assert_proxy('localhost', 9990, 'delayed', 'ohai')
+ end
+
should "handle noop" do
sock = TCPSocket.new('localhost', 9990)
sock.write('e' * 2048)
sock.flush
sock.write('f')
@@ -51,11 +55,11 @@
end
should "execute a callback" do
assert_proxy('localhost', 9990, 'h', '9980:h:callback')
end
-
+
should "call proxy_connect_error when a connection is rejected" do
sock = TCPSocket.new('localhost', 9990)
sock.write('connect reject')
sock.flush
assert_equal "", sock.read
@@ -71,10 +75,10 @@
assert_equal "", sock.read
assert_operator Time.now - sent, :>=, 1.0
assert_equal "activity error: localhost:9980", File.read(@proxy_error_file)
sock.close
end
-
+
should "call proxy_inactivity_error when initial read times out" do
sock = TCPSocket.new('localhost', 9990)
sent = Time.now
sock.write('inactivity')
sock.flush