Skip to content

Any instance prepend spike

gitlab-qa-bot requested to merge any-instance-prepend-spike into master

Created by: myronmarston

This is the start of my attempt at a fix for #661 (closed) 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 (closed), 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

Merge request reports