Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support compound stream matchers #1460

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Commits on Aug 18, 2024

  1. Add tests for compound matching on Output matchers

    This is the issue reported in rspec#1391 - expecting like
    
        expect { puts "foobar" }
          .to output.to_stdout(/foo/)
          .and output.to_stdout(/bar/)
    
    fails, because the two matchers get nested, and inner matcher catches
    the stream write, hiding it from the outer one.
    nevinera committed Aug 18, 2024
    Configuration menu
    Copy the full SHA
    cda1c90 View commit details
    Browse the repository at this point in the history
  2. Pass output along, if not in the outer matcher

    For the simple matchers, the solution is straightforward (and @pirj
    supplied it in the issue thread). Pass the output along to the original
    stream after storing it, unless the original stream is the _real_
    original stream.
    nevinera committed Aug 18, 2024
    Configuration menu
    Copy the full SHA
    1bc9e69 View commit details
    Browse the repository at this point in the history
  3. Nearly support compound matchers on CaptureStreamToTempfile

    Sadly, it doesn't quite work on StdErrSplitter, because of the existing
    (but possibly non-impactful?) bug around restoring the original stream
    during the ensure block.
    nevinera committed Aug 18, 2024
    Configuration menu
    Copy the full SHA
    7e7d458 View commit details
    Browse the repository at this point in the history
  4. Add a changelog entry

    pirj authored and nevinera committed Aug 18, 2024
    Configuration menu
    Copy the full SHA
    4175430 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    829f7fe View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2024

  1. Configuration menu
    Copy the full SHA
    d44f61f View commit details
    Browse the repository at this point in the history