From: Robert Klemme Date: 2005-03-15T23:31:20+09:00 Subject: Re: Mocking new and other class methods "jeem" schrieb im Newsbeitrag news:1110841831.161370.64390@o13g2000cwo.googlegroups.com... > >> Blocks with ensure could help here as transactional context > > (I just noticed this part of your note.) > > That's what MockNew.use does. You wrote "My big concern with the current method (see below) is that the real new might not be "put back" if a coder doesn't use MockNew.use." - from that I assumed that you did not use ensure. *If* you use ensure then the original code will always be put back in place - regardless whether you do normal or exceptional exit. Kind regards robert