/[cwmp]/google/t/05-store.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /google/t/05-store.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 80 by dpavlin, Fri Jun 22 14:32:13 2007 UTC revision 81 by dpavlin, Fri Jun 22 14:59:40 2007 UTC
# Line 4  use warnings; Line 4  use warnings;
4    
5  my $debug = shift @ARGV;  my $debug = shift @ARGV;
6    
7  use Test::More tests => 8;  use Test::More tests => 10;
8  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
9  use Cwd qw/abs_path/;  use Cwd qw/abs_path/;
10  use lib 'lib';  use lib 'lib';
# Line 18  $abs_path =~ s!/[^/]*$!/!;     #!fix-vim Line 18  $abs_path =~ s!/[^/]*$!/!;     #!fix-vim
18    
19  my $path = "$abs_path/var/state.db";  my $path = "$abs_path/var/state.db";
20    
21    unlink $path if -e $path;
22    
23  ok( my $store = CWMP::Store->new({  ok( my $store = CWMP::Store->new({
24          debug => $debug,          debug => $debug,
25          path => $path,          path => $path,
# Line 26  isa_ok( $store, 'CWMP::Store' ); Line 28  isa_ok( $store, 'CWMP::Store' );
28    
29  cmp_ok( $store->path, 'eq', $path, 'path' );  cmp_ok( $store->path, 'eq', $path, 'path' );
30    
31  ok( $store->update_state( 42, { foo => 'bar' } ), 'update_state' );  ok( $store->update_state( 42, { foo => 'bar' } ), 'update_state new' );
32    
33  ok( my $state = $store->db->get('42'), 'db->get' );  ok( my $state = $store->db->get('42'), 'db->get' );
34    
35  is_deeply( $state, { foo => 'bar' }, 'state' );  is_deeply( $state, { foo => 'bar' }, 'state' );
36    
37    ok( $store->update_state( 42, { baz => 12345 } ), 'update_state existing' );
38    
39    is_deeply( $state, { foo => 'bar', baz => 12345 }, 'new state' );

Legend:
Removed from v.80  
changed lines
  Added in v.81

  ViewVC Help
Powered by ViewVC 1.1.26