How to read from standard input during unit tests

Yeah, that makes perfect sense. Even if they’re integration tests, XCTest is still a solid harness for running them. No reason to reinvent the wheel just because they touch external APIs.