Support compound stream matchers
Currently, compound stream matchers aren't properly supported, because when the CompoundMatcher nests them, the inner matcher doesn't expose the captured output to the outer matcher. This results in #1391.
While resolving the issue for the to_stderr_from_any_process though, I found an additional problem, which is that this matcher didn't properly restore the RSpec::Support::StdErrSplitter to its original state after capturing (it leaves it pointed at a now-dead Tempfile stream).
This PR will be in draft state until I work out a resolution for that.
Fixes #1391
I think this is the solution: https://github.com/rspec/rspec-support/pull/598
There does still seem to be some issue in JRuby - it looks like JRuby has a different implementation of Tempfile, and as a result, the existing stream-reopen behavior doesn't produce objects that can distinguished from the original as we're currently doing. I'll be back once I can get JRuby working locally, I've never done anything in there -.-
I can reproduce those two failures on JRuby 9.4.7.0 + OpenJDK 22, which were a breeze to install with rvm/homebrew.
The only difference I could find is:
But to_io makes them return true in both cases for is_a?(File), even though both before and after to_io those are of a class Tempfile.
Is there anything else I can dig for you? What are your suspects?
I'm closing this as part of the monorepo migration because its a draft, but if you wanted to reopen it @nevinera it should be easier to work with there.