NAME
Test::RedisDB - start redis-server for testing
SYNOPSIS
use Test::RedisDB;
my $test_server = Test::RedisDB->new;
my $redis = $test_server->redisdb_client;
$redis->set('foo', 1);
my $res = $redis->get('foo');
DESCRIPTION
This module allows you to start an instance of redis-server for testing your modules that use RedisDB.
METHODS
$class->new(%options)
start a new redis-server instance, return Test::RedisDB object tied to this instance. Accepts the following options:
password
server should require a password to connect
$self->start
start the server. You only need to call this method if you stopped the server using the stop method
$self->stop
stop the server
$self->host
return hostname or address, at the moment always 'localhost'
$self->port
return port number on which server accept connections
$self->redisdb_client(%options)
return a new RedisDB client object connected to the test server, %options passed to RedisDB constructor
AUTHOR
Pavel Shaydo, <zwon at cpan.org>
LICENSE AND COPYRIGHT
Copyright 2011-2015 Pavel Shaydo.
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.