Before you dive into this — this isn't how I normally ship software, and I wouldn't recommend it for most projects. It worked here because Beanstalkd's interface is a small text protocol with well-defined behaviour, which makes it straightforward to test exhaustively. A web app