I think we may want something like this:

https://github.com/rspec/rspec-mocks/blob/3ac6f4e0155db12aa1ecbfe20d710e2d90c581fa/lib/rspec/mocks.rb#L76-L94

See https://github.com/rspec/rspec-mocks/commit/5d0e6deee8d9e6dc614b8c590a94aa168286de55 for the case that requires this.  @JonRowe, can you take care of porting that over here?

This is also something that could go into the `rspec-support` gem we've been discussing once we start on that.