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

Prevent error formatting from causing recursive errors #1275

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Commits on May 3, 2019

  1. Add reproduction spec for stack overflow in error formatting

    as initially reported in rspec/rspec-rails#2049
    
    The issue occurs when a class defines an `inspect` method which depends on
    methods that have been stubbed to e.g. `receive(...).at_most(n).times`.
    Failures try to call `inspect` which fails which calls `inspect` which ...
    jamesdabbs-procore committed May 3, 2019
    Configuration menu
    Copy the full SHA
    68e5f18 View commit details
    Browse the repository at this point in the history
  2. Prevent stack overflow when presenting error messages

    The error generator may make subsequent calls back in to the erroring
    method. This prevents those calls from cascading errors or incrementing
    the call count.
    jamesdabbs-procore committed May 3, 2019
    Configuration menu
    Copy the full SHA
    7b230f2 View commit details
    Browse the repository at this point in the history
  3. Rename variable; tweak style

    following comments from CR
    jamesdabbs-procore committed May 3, 2019
    Configuration menu
    Copy the full SHA
    bccc110 View commit details
    Browse the repository at this point in the history

Commits on Dec 11, 2019

  1. Update test for nested invocations

    If the error generator sends a message that we've expected `exactly` or `at_most` some number of times, we get a recursive error and stack overflow. This ensures that if we re-`invoke` while already `invoke`ing, we don't increment the count or allow errors to bubble up.
    jamesdabbs-procore committed Dec 11, 2019
    Configuration menu
    Copy the full SHA
    7437277 View commit details
    Browse the repository at this point in the history