major restructuring, specs probably all break

right now
This commit is contained in:
2011-01-28 17:09:30 +00:00
parent 8d5771a12a
commit 5496445d4d
16 changed files with 418 additions and 284 deletions

View File

@@ -16,3 +16,21 @@ module ServerHelper
end
end
#
# Helper methods
#
def start_server(port = 15762, timeout = 2)
bef_fork = EM.forks.clone
EM.fork {
EM.start_server('localhost', port, ServerHelper)
EM.add_timer(timeout) { EM.stop }
}
(EM.forks - bef_fork).first
end
def stop_server(pid)
Process.kill('TERM', pid)
end