On 1/25/07, Warren Seltzer <warrens / actcom.net.il> wrote:
> Thanks, I see how to make it work, but I don't see need to ever do it...

I stub #new all the time when testing Rails applications:

thing = mock("thing")
Thing.stub!(:new).and_return(thing)

This is extraordinarily useful when trying to isolate components for
testing, and I can only do this if the mock framework can override new
(which it does in this case).