Mocking stdout in tests

When testing a CLI applications I often stumble upon a problem of checking user-facing output of that application. There are few ways of doing it and worked out one that (at least for now :)) works flawlessly.

»