|Just another Perl shrine|
Params::Validate and Test::MockObject::Extendsby badaiaqrandista (Pilgrim)
|on May 09, 2006 at 05:46 UTC||Need Help??|
badaiaqrandista has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to write test for the application I am maintaining. It has a lot of OO modules. To start, I created a test like this for one of those modules (modified from the original code):
When I run the test, it breaks with Params::Validate error saying that 'owner' parameter is an object of 'T::MO::E::a', not 'MyApp::Property'. I guess this is because Params::Validate does not validate the 'owner' parameter by calling 'isa', but checking the perl's internal data structure to check 'isa'.
Is there anyway to go around this? Or do I have to create my own mock object library?