I feel like there should be a better way to do this. This test streams to a file then examines the output.