Test::MockObject - Perl extension for emulating troublesome interfaces
use Test::MockObject; my $mock = Test::MockObject->new(); $mock->set_true( 'somemethod' ); ok( $mock->somemethod() ); $mock->set_true( 'veritas') ->set_false( 'ficta' ) ->set_series( 'amicae', 'Sunny', 'Kylie', 'Bella' );
It's a simple program that doesn't use any other modules, and those are easy to test. More often, testing a program completely means faking up input to another module, trying to coax the right output from something you're not supposed to be testing anyway.
Testing is a lot easier when you can control the entire environment. With Test::MockObject, you can get a lot closer.
Test::MockObject allows you to create objects that conform to particular interfaces with very little code. You don't have to reimplement the behavior, just the input and the output.
chromatic, <chromatic at wgz dot org>
Copyright (c) 2002 - 2015 by chromatic <chromatic at wgz dot org>.
This program is free software; you can use, modify, and redistribute it under the same terms as Perl 5.10.x itself.