Make `any_instance` opt-in for RSpec 3.0
Created by: myronmarston
any_instance
is a code smell and is easily the most complicated part of rspec-mocks. I think it's an OK tool to use to get legacy code under test but I don't recommend it's use for new code (instead, your tests should be driving your design and encouraging you to allow dependencies to be injected).
Given that, it'd be good to have a way to disable any_instance
all together when you're on a greenfield project. Beyond that, I think it's best to make any_instance
require you to opt-in to make it available via a config setting, as that sends a signal that you should think before using it.
Thoughts?
/cc @alindeman @dchelimsky @JonRowe @samphippen @soulcutter