A helper for testing output of a process in tests.