Hi Nick,

The trick is that `_pass_with` actually runs first, and when it runs
`actual.call`, it calls `pass`.
What you can do is to skip the check in `pass` if `actual.call` returns
`false`, i.e. `pass` failed matching.

All the best in 2022!

- Phil

On Sun, Jan 2, 2022 at 8:18 PM Nick Sutterer <[email protected]> wrote:

> Currently, we have a matcher `assert_pass` that internally combines two
> matchers as follows.
>
> ```ruby
> def pass_with(args)
>   pass.and _pass_with(args) # TODO: abort when {pass} fails
> end
> ```
>
> What we need, though, is to have `pass` abort if it fails, and not run
> `_pass_with`. Presently, both matchers are run regardless of which one
> fails. Is it possible to do so?
>
> Many thanks in advance and best wishes for 2022,
>
> Nick
>
> --
> You received this message because you are subscribed to the Google Groups
> "rspec" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rspec/ecdfcced-840c-49e4-9095-22c1ebd510f6n%40googlegroups.com
> <https://groups.google.com/d/msgid/rspec/ecdfcced-840c-49e4-9095-22c1ebd510f6n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/CAAk5Ok_Lu%3D3rx-%2BZYgUdgiiF3DEvPD7y_BHfJ3X-2Yex83e2oQ%40mail.gmail.com.

Reply via email to