NAME
Test::Mock::Redis - use in place of Redis for unit testing
VERSION
Version 0.04
SYNOPSIS
Test::Mock::Redis can be used in place of Redis for running tests without needing a running redis instance.
use Test::Mock::Redis;
my $redis = Test::Mock::Redis->new(server => 'whatever');
...
$redis->set($key, 'some value');
$redis->get($key);
This module is designed to function as a drop in replacement for Redis.pm for testing purposes.
See perldoc Redis and the redis documentation at http://redis.io
SUBROUTINES/METHODS
new
Create a new Test::Mock::Redis object.
It can be used in place of a Redis object for unit testing.
If you pass the server to "connect" to, it will be ignored.
TODO
Lots!
Not all Redis functionality is implemented. The test files that output "TODO" are still to be done.
The top of all test files [except 01-basic.t] has the list of commands tested or to-be tested in the file.
Those marked with an "x" are pretty well-tested. Those marked with an "o" need help. Those that are unmarked have no tests, or are un-implemented. For example:
x AUTH <--- has some tests x SET o KEYS <--- only partially tested and/or implemented ZINTERSTORE <--- not tested (or maybe not implemented)
Beyond that, it would be neat to add methods to inspect how often keys were accessed and get other information that allows the module user to confirm that their code interacted with redis (or Test::Mock::Redis) as they expected.
AUTHOR
Jeff Lavallee, <jeff at zeroclue.com>
SEE ALSO
The real Redis.pm client whose interface this module mimics: http://search.cpan.org/dist/Redis
BUGS
Please report any bugs or feature requests to bug-mock-redis at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Mock-Redis. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Test::Mock::Redis
You can also look for information at:
RT: CPAN's request tracker
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
ACKNOWLEDGEMENTS
Salvatore Sanfilippo for redis, of course!
Dobrica Pavlinusic & Pedro Melo for Redis.pm
LICENSE AND COPYRIGHT
Copyright 2011 Jeff Lavallee.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.