Search code examples
crystal-lang

Is there a way to redirect STDERR in Crystal?


It would be convenient to redirect STDERR during tests. Is this possible in Crystal?


Solution

  • There is no way of doing it with just the standard library, but there is an external library that does the low-level operation.

    https://github.com/mosop/stdio
    A small Crystal library for capturing standard I/O streams