rspec/rspec-mocks — pull request #234 by JonRowe (2013-03-03 03:13:22+00:00)
Title: Fix issue #229 runtime error caused by duplicating an object which is frozen and stubbing with any_instance

Bizarely dup doesn't work as expected when you remove the mock proxy, I'm not entirely certain what's going on here but removing the mock proxy causes it to not duplicate correctly, and leaving the mock proxy causes stack level too deep errors, (which I assume is due to sharing a mockproxy across the two objects). However switching from clearing the proxy on the original to recreating it on the copy seems to work.

As I'm not intimately familar with rspec's internals it's intirely possible I'm wrong with this so review is appreciated.