Put together stream capturing for isolated tests.