File: manual_start.t

package info (click to toggle)
libtest-redisserver-perl 0.21-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 188 kB
  • sloc: perl: 171; makefile: 11; sh: 4
file content (25 lines) | stat: -rw-r--r-- 547 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use strict;
use warnings;
use Test::More;

use Redis;
use Test::RedisServer;

eval { Test::RedisServer->new } or plan skip_all => 'redis-server is required in PATH to run this test';

my $server = Test::RedisServer->new( auto_start => 0 );

my $redis;
eval {
    $redis = Redis->new($server->connect_info);
};
ok !$redis, 'redis client object was not created ok';
like $@, qr/Could not connect to Redis server/, 'error msg ok';

$server->start;

$redis = Redis->new($server->connect_info);

is $redis->ping, 'PONG', 'ping pong ok';

done_testing;