rspec/rspec-mocks — pull request #666 by myronmarston (2014-05-05 17:20:04+00:00)
Title: Any instance prepend spike

This is the start of my attempt at a fix for #661 and #582.

I've worked on this for a few days....and getting this to work is _very_ complicated. I got the initial spec to pass but then I wanted to confirm that the use of a prepended module works for all the other `any_instance` behaviors and so I temporarily hardcoded `klass_has_prepended_module?` to return true...and lots of stuff failed. Getting this to work is not going to be easy.

So, I'm thinking that for now maybe we provide an explicit "stubbing any instance when the class has a prepended module that defines the same method is not supported" error message. While that wouldn't solve @pex's failure as reported in #661, it would provide an explicit error rather than a confusing `SystemStackError`, and given that `any_instance` is a feature we recommend not using, I don't want to spend tons of effort complicating it to make it support module prepends.

Thoughts?

/cc @xaviershay @JonRowe @samphippen @cupakromer @soulcutter