/[cwmp]/google/trunk/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

Annotation of /google/trunk/t/05-store.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 79 - (hide annotations)
Fri Jun 22 14:32:13 2007 UTC (17 years ago) by dpavlin
Original Path: google/t/05-store.t
File MIME type: application/x-troff
File size: 647 byte(s)
added store->update_state and use it
1 dpavlin 77 #!/usr/bin/perl
2     use strict;
3     use warnings;
4    
5     my $debug = shift @ARGV;
6    
7 dpavlin 79 use Test::More tests => 8;
8 dpavlin 77 use Data::Dump qw/dump/;
9     use Cwd qw/abs_path/;
10     use lib 'lib';
11    
12     BEGIN {
13     use_ok('CWMP::Store');
14     }
15    
16     ok(my $abs_path = abs_path($0), "abs_path");
17     $abs_path =~ s!/[^/]*$!/!; #!fix-vim
18    
19     my $path = "$abs_path/var/state.db";
20    
21     ok( my $store = CWMP::Store->new({
22     debug => $debug,
23     path => $path,
24     }), 'new' );
25     isa_ok( $store, 'CWMP::Store' );
26    
27     cmp_ok( $store->path, 'eq', $path, 'path' );
28 dpavlin 79
29     ok( $store->update_state( 42, { foo => 'bar' } ), 'update_state' );
30    
31     ok( my $state = $store->db->get('42'), 'db->get' );
32    
33     is_deeply( $state, { foo => 'bar' }, 'state' );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26