rspec-mocks icon indicating copy to clipboard operation
rspec-mocks copied to clipboard

deprecate any_instance_of family of methods

Open HoneyryderChuck opened this issue 3 years ago • 6 comments

deprecate any_instance_of family of methods

rubocop-rspec already discourages the use of allow/expect_any_instance_of, and a workaround is provided.

Also, from the rspec documentation around these methods, it's argued that using it is a "design smell", it's a "complicated feature", and "no one in the core team uses it".

In light of all that, couldn't the rspec team just deprecate the methods, and log the rubocop workaround? I'm saying that because it's hard for me to justify not using rspec features based on rubocop feedback (sometimes rubocop suggestions are just "opinionated"), and given all the described difficulties and the existence of an alternative solution, maybe the rspec team could send that clear message themselves via deprecation.

HoneyryderChuck avatar May 21 '21 09:05 HoneyryderChuck