-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
deprecate any_instance_of family of methods #1423
Comments
No objections to deprecating it. However, its removal should happen with a major version release. A viable option would be to extract it to a gem, add it as a depency for With an upcoming release of RSpec 4 I believe it's too late to deprecate Would you like to hack on extracting |
Totally fine with the points you raised. Just feel that, overall, the decision of telling users not to use a non-recommended feature should ultimately come from the tool, rather than the linter.
No, sorry. I use rspec only at work. And I wouldn't keep using the feature even if it were via an optional dependency. |
We all do. And companies rarely make time for their employees to contribute to open source. |
Sorry, maybe I expressed myself incorrectly. I don't want to extract the Any further work would require me to need something or buying in to the project. Which I would do, and I've gladly done in the past for rspec-related projects. I think that, in this case, the rspec team "needs" to deprecate this API more than I do (I've seen "any_instance" mentioned in the issues page a lot), hence the suggestion. Feel free to close the ticket if you think otherwise. I agree with your whole assessment "if you use it, be prepared to contribute and pay for it", I also maintain other OSS projects, so I can relate. |
Not necessarily you'll have to commit to maintaining something you'll never use yourself. @JonRowe What is the plan for the |
Personally, I feel there is a difference between "we don't recommend" and "don't use"; Deprecation is the latter of those two, it's don't use as this will be removed soon. Until we have a plan to extract or otherwise remove it from the main rspec gems, we can't really deprecate it. We as a team don't recommend it's use, but as far as we know it's still wildly used in Rails codebases which makes it painful for it to be officially deprecated without a plan to support it at least as an external gem. |
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.
The text was updated successfully, but these errors were encountered: