Inside the call to Stub or Expect On Mon, Dec 1, 2008 at 11:44 AM, Linus Roslund <[EMAIL PROTECTED]>wrote:
> Thanks for your answers. Yes it solved the problem with BackToRecord, it > allowed me to redefine an expectation that I had already set up in the > SetUp. And the solution is quite obvious but I didn't think about it before. > > A follow up question though. Now when the new syntax is around I mostly > don't have to care about the state the stubs/mocks have but an interesting > question is: *when* is the stub set to Replay state when using the new > syntax? > > /Linus > > Linus Roslund > Dotway AB, Malmö > +46 (0)768 - 51 00 50 > ----------------------------- > Øredev - 19-21 November 2008 - www.oredev.org > > > > On Mon, Dec 1, 2008 at 01:31, Ayende Rahien <[EMAIL PROTECTED]> wrote: > >> BackToRecord allow you to optionally reset the existing expectations on an >> mock >> >> >> On Sun, Nov 30, 2008 at 10:48 PM, ssteinegger <[EMAIL PROTECTED]>wrote: >> >>> >>> Ayende: I'm not sure that this is what Linus is looking for. As I >>> understood (I may be wrong) BackToRecord allows you to define >>> _additional_ behaviour to a mock / stub which is already in replay >>> mode. Linus wants to _change_ the expectations or results he already >>> defined. >>> >>> Linus: I already had the same problem. I solved it by setting up the >>> expectations in a helper method that could be called or not. This >>> makes you more flexible when you have more different tests. You could >>> also use arguments on this helper method. Just don't make it to >>> complicated to keep your tests clear. >>> >>> Ayende Rahien wrote: >>> > BackToRecord >>> > >>> > On Fri, Nov 28, 2008 at 3:31 PM, Linus Roslund < >>> [EMAIL PROTECTED]>wrote: >>> > >>> > > Is it possible to change a stub's behaviour after it has been set >>> once? >>> > > >>> > > I'd like to set up a stub in the SetUp with a default behaviour and >>> inject >>> > > it to my SUT and then in some tests I want to change the behaviour - >>> without >>> > > injecting a new stub. >>> > > >>> > > Is it possible? If not, it would certainly be desirable. >>> > > >>> > > /Linus >>> > > >>> > > >>> > > > >>> > > >>> >>> >> >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Rhino.Mocks" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/RhinoMocks?hl=en -~----------~----~----~----~------~----~------~--~---
