44 |
$data->{baz} = 42; |
$data->{baz} = 42; |
45 |
ok( $o->store( $path, $data ), 'store again' ); |
ok( $o->store( $path, $data ), 'store again' ); |
46 |
|
|
47 |
my $new; |
ok( my $new = $o->reload( $path ), 'reload' ); |
|
ok( $o->reload( $path, \$new ), 'reload' ); |
|
48 |
|
|
49 |
diag dump( $data, $new ) if $debug; |
diag dump( $data, $new ) if $debug; |
50 |
is_deeply( $data, $new, 'same' ); |
is_deeply( $data, $new, 'same' ); |
51 |
|
|
52 |
my $keep = { 'test' => 'data' }; |
ok( ! $o->reload( $path ), 'no reload' ); |
53 |
my $new2 = $keep; |
|
54 |
ok( ! $o->reload( $path, \$new2 ), 'reload' ); |
ok( ! $o->load( 'var/something.which.doesnt.exist' ), 'load without file' ); |
|
is_deeply( $keep, $new2, 'same' ); |
|