|
#!perl
use 5.006;
use Test::More skip_all => "Needs hardcoded schema details." ; my $logger = get_mlogger;
BEGIN {
use_ok( 'CHI' ) || print "Bail out!\n" ;
}
my ( $chi , $schema );
ok( $schema = get_schema, "Got a schema" );
ok( $schema ->resultset( 'Mbfl2Session' )->search( {} )->count > 0, "Found some sessions" );
ok(
$chi = CHI->new(
driver => 'DBIC' ,
table => 'Mbfl2Session' ,
schema => $schema ,
expires_on_backend => 1,
expires_in => 30
),
"Got a CHI object."
);
my $key = "testing_chi_dbic" ;
my $val = 1234;
is( $chi ->get( $key ), $val , "Retrieved key $key. It has value $val" );
sleep 30;
ok( ! $chi ->get( $key ), "$key has expired" );
diag( "Testing CHI::Driver::DBIC $CHI::Driver::DBIC::VERSION, Perl $], $^X" );
done_testing;
|