On Fri, 2004-08-20 at 11:24, Geoffrey Young wrote: > Test::MockObject is clearly object/instance based. > Test::MockObject::Extends is documented to mock either an object or the > class as a whole. if that's not the case that is fine (I guess ;), but then > I'm very confused what value passing a class name to new() adds - the docs > claim that it is for mocking class methods, doesn't it?
The docs may be misleading, especially as there's code in Test::MockObject that really should live in something like Test::MockModule or Test::MockPackage, neither of which exist yet. The important point is that you always have to work with the object returned from Test::MockObject::Extends->new(), as it's the only one with the special instancey behavior. If you want to override globally a class method to return T::MO::E objects, you're mostly on your own. It might be *useful* to do that with T::MO::E somehow, but I'd rather make the mistake of not blurring the mock object/mock package thing in T::MO::E, having done the opposite in T::MO. -- c