Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

test::mock::redis(3pm) [debian man page]

Test::Mock::Redis(3pm)					User Contributed Perl Documentation				    Test::Mock::Redis(3pm)

NAME
Test::Mock::Redis - use in place of Redis for unit testing VERSION
Version 0.08 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. It accepts the "server" argument, just like Redis.pm's new. 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 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 <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: o RT: CPAN's request tracker http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Mock-Redis <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Mock-Redis> o AnnoCPAN: Annotated CPAN documentation http://annocpan.org/dist/Test-Mock-Redis <http://annocpan.org/dist/Test-Mock-Redis> o CPAN Ratings http://cpanratings.perl.org/d/Test-Mock-Redis <http://cpanratings.perl.org/d/Test-Mock-Redis> o Search CPAN http://search.cpan.org/dist/Test-Mock-Redis/ <http://search.cpan.org/dist/Test-Mock-Redis/> 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. perl v5.14.2 2012-04-16 Test::Mock::Redis(3pm)

Check Out this Related Man Page

Apache::Session::Browseable::Redis(3pm) 		User Contributed Perl Documentation		   Apache::Session::Browseable::Redis(3pm)

NAME
Apache::Session::Browseable::Redis - Add index and search methods to Apache::Session::Redis SYNOPSIS
use Apache::Session::Browseable::Redis; my $args = { server => '127.0.0.1:6379', # Choose your browseable fileds Index => 'uid mail', }; # Use it like Apache::Session my %session; tie %session, 'Apache::Session::Browseable::Redis', $id, $args; $session{uid} = 'me'; $session{mail} = 'me@me.com'; $session{unindexedField} = 'zz'; untie %session; # Apache::Session::Browseable add some global class methods # # 1) search on a field (indexed or not) my $hash = Apache::Session::Browseable::Redis->searchOn( $args, 'uid', 'me' ); foreach my $id (keys %$hash) { print $id . ":" . $hash->{$id}->{mail} . " "; } # 2) Parse all sessions # a. get all sessions my $hash = Apache::Session::Browseable::Redis->get_key_from_all_sessions(); # b. get some fields from all sessions my $hash = Apache::Session::Browseable::Redis->get_key_from_all_sessions('uid', 'mail') # c. execute something with datas from each session : # Example : get uid and mail if mail domain is my $hash = Apache::Session::Browseable::Redis->get_key_from_all_sessions( sub { my ( $session, $id ) = @_; if ( $session->{mail} =~ /mydomain.com$/ ) { return { $session->{uid}, $session->{mail} }; } } ); foreach my $id (keys %$hash) { print $id . ":" . $hash->{$id}->{uid} . "=>" . $hash->{$id}->{mail} . " "; } DESCRIPTION
Apache::Session::browseable provides some class methods to manipulate all sessions and add the capability to index some fields to make research faster. SEE ALSO
Apache::Session AUTHOR
Xavier Guimard, <x.guimard@free.fr> COPYRIGHT AND LICENSE
Copyright (C) 2009 by Xavier Guimard This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available. perl v5.14.2 2010-12-08 Apache::Session::Browseable::Redis(3pm)
Man Page