Add spec which tests writing to sockets