Fix output.to_stdout_from_any_process when $stdout has been reassigned
(An alternate fix for https://github.com/rspec/rspec-core/pull/3113)
When running under rspec bisect runner, $stdout & $stderr are reassigned to a StringIO, which would cause "can't convert Tempfile into StringIO" when trying to reopen the stream in CaptureStreamToTempfile
Since CaptureStreamToTempfile reopens the stream rather than reassigning it, I think it makes sense to use STDOUT rather than whatever the current value of $stdout is.
(Please feel free to sanity-check that assumption. I've gone round in circles a few too many times on this)
I don't have any objections to this approach apart from the fact it breaks our build due to having already redeclared std out, I'm not sure how to fix this yet...
I've pushed a possible fix, where instead of reopening $stderr, it reopens STDERR and reassigns $stderr.
I'm not entirely sure it's going to work, but see what you think and I can squash it if desired.
Migrated to the monorepo as rspec/rspec#151