How to read from standard input during unit tests

I guess I could create a local server using Vapor.

Even setting aside the complexity and the amount of time it would take, mocking the Spotify web API has its own issues. For example, what if it changes? If my mocked version was based on an old version of the Spotify web API, then I would never know about the change. Furthermore, some tests involve the player endpoints (e.g., playing tracks, toggling shuffle, skipping to the next track, retrieving the currently playing track). It would be unfeasible for me to mock that functionality.

I just can't believe that it's this hard to read from the standard input during unit tests. It shouldn't be that hard. Surely I can't be the first person who needs to do this.