Redis/t/CHIDriverTests.pm

filter: Statementstmt 100% 27 / 27 Branchbran 50.0% 2 / 4 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 10 / 10 Podpod 0.0% 0 / 4 totaltotal 83.3% 40 / 48 CC 4 SCAR 7.8
CC
4
Cov
91%
new_cache_options
4.8
BEGIN
1.0
BEGIN
1.0
CRAP 2.2
« Redis.pm ↑ Summary
1 package CHI::Driver::Redis::t::CHIDriverTests;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use CHI::Test;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use base qw(CHI::t::Driver);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use Test::Mock::Redis;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 139 ▶sub testing_driver_class { 'CHI::Driver::Redis' }
Subroutine testing_driver_class: called CC=1 SCAR=0.0
Pod undocumented
11  
12 1 ▶sub supports_expires_on_backend { 1 }
Subroutine supports_expires_on_backend: called CC=1 SCAR=0.0
Pod undocumented
13  
14 sub new_cache_options {
15 135 ▶ my $self = shift;
Subroutine new_cache_options: called CC=4 SCAR=15.8
Pod undocumented
16  
17 return (
18 $self->SUPER::new_cache_options(),
19 driver_class => 'CHI::Driver::Redis',
20 redis_class => (defined $ENV{CHI_REDIS_SERVER} ? 'Redis' : 'Test::Mock::Redis'),
21 server => $ENV{CHI_REDIS_SERVER} || undef,
22 135 ▶ ($ENV{CHI_REDIS_PASSWORD} ? ( password => $ENV{CHI_REDIS_PASSWORD} ) : ()),
Branch: 2 branches
BranchTrueFalseTotal
defined $ENV{'CHI_REDIS_SERVER'} ? : 0 135 135
$ENV{'CHI_REDIS_PASSWORD'} ? : 0 135 135
Condition50%1/2
$ENV{'CHI_REDIS_SERVER'} || undef
l!l
0135
MC/DC0%0/1
$ENV{'CHI_REDIS_SERVER'} || undef
$ENV{'CHI_REDIS_SERVER'}
Truth table50%1/2
A
A= $ENV{'CHI_REDIS_SERVER'}
Aresult
11
00
23 prefix => 'test' . $$ . ':',
24 );
25 }
26  
27 sub clear_redis : Test(setup) {
28 48 ▶ my ($self) = @_;
Subroutine clear_redis: called CC=1 SCAR=0.0
Pod undocumented
29  
30 48 my $cache = $self->new_cache;
31 48 $cache->_verify_redis_connection;
32 48 $cache->redis->flushall;
33 1 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
34  
35 1 1;
« Redis.pm ↑ Summary