add support for mocking stdout/stderr in tests