> 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.
ok, now I see where you're going :) living with the object limitation is fine, as that handles most of the general cases - I can still use fake_new() so that the calling class constructs a mock object of my choosing. however, I might suggest that there be some generic fake_constructor($name) method or something - if I want to subvert, say, DBI behind the scenes I would want to override connect() for the class instead of new(). also, if you fancy making fake_new() return $self, mock() and unmock() in Extends also don't return $self, which makes them different from the MockObject versions. anyway, thanks for taking the time to discuss things a bit :) --Geoff