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

yield_control hardening #1167

Merged
merged 2 commits into from Mar 18, 2020
Merged

Commits on Mar 17, 2020

  1. Detect invalid argument given to yield_control.exactly / at_least / a…

    …t_most
    
    Currently, `exactly(:trice)` would always provide a failure with message 'expected given block to yield control', even if control was yielded.
    
    `at_least(:trice)` yields a cryptic error 'ArgumentError: comparison of Integer with nil failedinstead of an error as it should'.
    
    Some unused code was detected and removed.
    marcandre committed Mar 17, 2020
    Copy the full SHA
    94b4293 View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2020

  1. Raise error on multiple count constraints.

    In particular, it would be reasonable to expect yield_control.at_least(1).at_most(4).times to work
    
    This also simplifies the failure message in case no count constraint was called.
    marcandre committed Mar 18, 2020
    Copy the full SHA
    04efb1f View commit details
    Browse the repository at this point in the history