Mock::Quick::Object(3) Object mocking for Mock::Quick

DESCRIPTION

Provides object mocking. See Mock::Quick for a better interface.

SYNOPSIS


use Mock::Quick::Object;
use Mock::Quick::Method;
my $obj = Mock::Quick::Object->new(
foo => 'bar', # define attribute
do_it => qmeth { ... }, # define method
...
);
is( $obj->foo, 'bar' );
$obj->foo( 'baz' );
is( $obj->foo, 'baz' );
$obj->do_it();
# define the new attribute automatically
$obj->bar( 'xxx' );
# define a new method on the fly
$obj->baz( Mock::Quick::Method->new( sub { ... });
# remove an attribute or method
$obj->baz( \$Mock::Quick::Util::CLEAR );

AUTHORS

Chad Granum [email protected]

COPYRIGHT

Copyright (C) 2011 Chad Granum

Mock-Quick is free software; Standard perl licence.

Mock-Quick is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.