Hello
RSpec tries not to monkey patch standard Ruby methods, so `puts` etc will always try to output to `$stdout`, we do provide a matcher which redirects `$stdout` and/or `$stderr` to a `StringIO` temporarily, which can be used as:
```
expect { code }.to output.to_stdout # and/or `to_stderr`
```
But thats temporary and has a few limitations (we don't overwrite `STDOUT` / `STDERR` and if code has captured the globals we obviously can't change those references.
If you wanted to do this yourself throughout the spec run its very easy to do in Ruby, for example to redirect stdout to stderr during the run of a test you could do:
```
RSpec.configure do |config|
config.around(:example) do |example|
original_stdout = $stdout
$stdout = $stderr
example.call
$stdout = original_stdout
end
end
```
Note it would be important to set stdout back to get the normal output during the spec run.
Hope that helps achieve what you want.
Cheers
Jon