Refactor FakeSource from a module to a class

This commit is contained in:
Alex Young
2012-07-03 14:39:05 +01:00
parent ded4914c84
commit 64ebbe7688
7 changed files with 70 additions and 54 deletions

View File

@@ -8,15 +8,17 @@
# is still alive.
require 'flexnbd/fake_source'
include FlexNBD::FakeSource
include FlexNBD
addr, port = *ARGV
client_sock = connect( addr, port, "Timed out connecting." )
read_hello( client_sock )
client_sock.close
client = FakeSource.new( addr, port, "Timed out connecting." )
client.read_hello
client.close
sleep(0.2)
connect( addr, port, "Timed out reconnecting." )
FakeSource.new( addr, port, "Timed out reconnecting." )
exit(0)