From: Steve F. <st...@m3...> - 2003-07-03 07:47:29
|
Nat Pryce wrote: > From: "Steve Freeman" <st...@m3...> >>We argued this one out and thought that in most case people either care >>about the order or they don't. > It seems that there are always some methods that can occur out of order > (toString, etc.). if they matter, then put them in the expectations (this is another motivation for restructuring the special cases). >>I'm not so keen on the newSequence() >>because it doesn't make clear what happens to expectations applied to >>the originating Mock. At least the OrderedMock has only one visible >>behaviour. > Could this be fixed by a better name? not sure. it's more about 2 interfaces to the same behaviour. >>We also considered adding something like: >> listener.expectVoid( "first", C.before("second") ); > This gets tricky because you need to unambiguously identify the first and > second methods, and that gets difficult with the flexible way that methods > are matched using decorators. I find that putting callable objects into > sequences makes this explicit and is not very verbose. I suspect that simple name matching would work in practice. We also talked about adding a before() method to the callable objects, which would be unambiguous, but I couldn't be bothered to type in the example... S. -- "A LISP programmer knows the value of everything but the cost of nothing. A C programmer knows the cost of everything but the value of nothing." (Todd Proebsting) |