On Thursday 05 October 2006 12:48, Christopher H. Laco wrote: > I won't pretend not be be confused at the moment then, because I have > other tests that do: > > T::MO->new->fake_module('Foo'), and classes that 'use Foo' and do > 'Foo->new' just work with the mocked verson. At least, I thought they > did, and they don't throw the same error.
They'd better not, because there's no code in T::MO that gives you a default constructor. Perhaps you're using fake_new() instead? > How is above any different than this: s/GEO::IP/Apache/ ? > > http://www.perl.com/pub/a/2005/04/07/mockobject_kata.html?page=2 > > Obviously, my brain is not working right today. Let me put it another way. In the absence of you explicitly saying "Pretend that you've loaded this module and pretend that these subroutine references correspond to these method names", how is it possible that T::MO can provide all of the appropriate methods that your code wants to use later in the test file, perform the appropriate behavior, and return the appropriate values? It doesn't do that. What in the documentation leads you to believe it does? If I can clarify the behavior, I will. -- c