Skip to content

Create allow_next_instance_of spec helper

We already have expect_next_instance_of, but in some cases it's also useful to have a allow_next_instance_of.

This issue is a follow-up from a discussion on slack. And also discussed on the Backend weekly call

Motivation

@smcgivern shared his opinion:

IMO we should only use expect in message stubs when we actually depend on that, not when it's incidental to the test

Not everyone agrees with that, but giving code authors the choice between expect_next_instance_of and allow_next_instance_of cannot be a bad thing.

Docs changes

Currently the docs modify allow_any_instance_of into expect_next_instance_of, which is confusing.

Edited by Toon Claes