/testutils

Testing helpers

Primary LanguageGoMIT LicenseMIT

testutils Build Status Go Report Card Coverage Status

Package testutils provides useful test helpers.

Details

  • CaptureStdout, CaptureSterr and CaptureStdoutAndStderr: capture stdout, stderr or both for testing purposes. All capture functions are not thread-safe if used in parallel tests, and usually it is better to pass a custom io.Writer to the function under test instead.

Install and update

go get -u github.com/go-pkgz/testutils