use warnings;
use strict;
-use Test::More tests => 110;
+use Test::More tests => 111;
use Data::Dumper;
use lib 'lib';
cmp_ok( $o->get( 'foo' ), 'eq', 'bar', 'get foo = bar' );
+SKIP: {
+ skip "set REDIS_RESTART to init script location to test reconnect code", 1 unless $ENV{REDIS_RESTART};
+
+ diag( 'Restarting redis server' );
+ $o->save();
+
+ `sudo $ENV{REDIS_RESTART} restart`;
+
+ cmp_ok( $o->get( 'foo' ), 'eq', 'bar', 'get foo = bar still works after restart' );
+}
+
ok( $o->set( foo => 'baz' ), 'set foo => baz' );
cmp_ok( $o->get( 'foo' ), 'eq', 'baz', 'get foo = baz' );