adds capture for stdin and tests