| Module Info
| Add a review of Test-MockObject
Excellent stuff, really useful when writing decent test scripts. For code that relies on external systems, mocking up whatever objects it uses to communicate with them makes in-depth, reliable testing easy.
This is a good idea and a good implentation with a few exceptions. This module is easy to use and good documentation.
I cannot mock out methods that conflict with real Test::MockObject methods such as remove, mock, set_true, set_false, etc.
There is no next_call like method for class methods.
Test::MockObject is a great idea, mostly well executed.
When you really get into a jam, testing something very tricky or unusual, it is the veritable knight in shining armor for your testing script. As a concept and for _most_ of its coding it scores a natural 5.
But it suffers from two points, for which I remove 2 points :)
Firstly, it makes use of UNIVERSAL::can and UNIVERSAL::isa. The subject of these two modules is extremely sensitive, and in particular the author and I are the most vocal of those on either side of the (mostly) religious argument on this.
But since this score is opinion-based, I'm taking off a point for insisting on using them, without the option to disable. They modify some of the most core functions in Perl to act differently, which causes action at a distance, and I've been bitten before a couple of times by code (generally very deep or magic code) acting differently just because Test::MockObject was LOADED (without even using it).
Secondly, I'm removing a point because I think the move to up the version to 1.00 is premature. I'd still consider it late beta quality.
I find I can still poke holes in this module and find bugs fairly regularly and fairly easily.
That's not to slight the author at all, who is always quite responsive to fixing the bugs. But I still think bugs are too easy to find to call to consider it production grade, given the advanced magic it is trying to do.
I guess I'd just like to see someone spend half a day or so _intentionally_ trying to break this module with corner cases before we moved it to production versioning.
Because as much as I appreciate the bug fixes, it would be nice if I wasn't able to find them so easily.
This was the perfect tool to help test the upcoming HTML::Template::Plugin::Dot module, which allows chained accessor calls to be referenced in a template, like TT does.
We needed to test lots of method calls, but not for any particular module. Making generic fake objects was very handy and fast with this module.
I couldn't think of a better interface for mock objects.
The documentation is exceptionally superb, and the module itself is very usable too.