Skip to content

Instantly share code, notes, and snippets.

Created June 24, 2011 00:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1043991 to your computer and use it in GitHub Desktop.
Save anonymous/1043991 to your computer and use it in GitHub Desktop.
Fork server to run integration tests while cleaning up processes.
pid = fork { exec("script/server") }
sleep(10)
puts "Test 1"
puts "Test 2"
puts "Test 3"
Process.kill("KILL", pid) rescue nil
pid, status = Process.waitpid2(pid)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment