2 |
use strict; |
use strict; |
3 |
use warnings; |
use warnings; |
4 |
|
|
5 |
use Test::More tests => 13; |
use Test::More tests => 21; |
6 |
use lib 'lib'; |
use lib 'lib'; |
7 |
|
|
8 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
27 |
ok( my $o = Mock->new( debug => $debug ), 'new' ); |
ok( my $o = Mock->new( debug => $debug ), 'new' ); |
28 |
diag $o->dump(2) if $debug; |
diag $o->dump(2) if $debug; |
29 |
|
|
30 |
|
foreach my $path ( map { "var/t/Frey.Storage.$_" } ( 'yaml', 'storable' ) ) { |
31 |
|
|
32 |
|
diag $path; |
33 |
|
|
34 |
my $data = { foo => 'bar' }; |
my $data = { foo => 'bar' }; |
|
my $path = 'var/t/Frey.Storeage.yaml'; |
|
35 |
|
|
36 |
ok( $o->store( $path, $data ), 'store' ); |
ok( $o->store( $path, $data ), 'store' ); |
37 |
|
|
54 |
|
|
55 |
ok( ! $o->reload( $path ), 'no reload' ); |
ok( ! $o->reload( $path ), 'no reload' ); |
56 |
|
|
57 |
|
} # foreach |
58 |
|
|
59 |
ok( ! $o->load( 'var/something.which.doesnt.exist' ), 'load without file' ); |
ok( ! $o->load( 'var/something.which.doesnt.exist' ), 'load without file' ); |