/[A3C]/t/50-strix.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 /t/50-strix.t

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

revision 212 by dpavlin, Tue Jun 17 21:27:31 2008 UTC revision 213 by dpavlin, Fri Jun 20 20:44:18 2008 UTC
# Line 8  test Strix integration Line 8  test Strix integration
8    
9  =cut  =cut
10    
11  use Jifty::Test tests => 10;  use Jifty::Test tests => 21;
12    
13  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
14    
# Line 26  isa_ok( $dbh, 'DBI::db' ); Line 26  isa_ok( $dbh, 'DBI::db' );
26  ok( my $strix = Strix->new({ instance => $instance }), 'new' );  ok( my $strix = Strix->new({ instance => $instance }), 'new' );
27  isa_ok( $strix, 'Strix' );  isa_ok( $strix, 'Strix' );
28    
29    # cache
30    ok( my $path = $strix->cache_path( 'test-%d-%s', 42, 'bar' ), 'cache_path' );
31    like( $path, qr/test-42-bar$/, 'correct' );
32    
33    my $data = 'scalar';
34    SKIP: {
35    skip( 'scalars not supported', 2 );
36    ok( $strix->write_cache( $data, 'test-scalar' ), 'write_cache scalar' );
37    is_deeply( $strix->read_cache( 'test-scalar' ), $data, 'read_cache scalar' );
38    }
39    $data = { foo => 42, bar => 'baz' };
40    ok( $strix->write_cache( $data, 'test-hash' ), 'write_cache hash' );
41    is_deeply( $strix->read_cache( 'test-hash' ), $data, 'read_cache hash' );
42    $data = [ 1, 2, 42 ];
43    ok( $strix->write_cache( $data, 'test-array' ), 'write_cache array' );
44    is_deeply( $strix->read_cache( 'test-array' ), $data, 'read_cache array' );
45    
46  my $url = '/';  my $url = '/';
47    
48  ok( my $category = $strix->category( $url ), "category $url" );  ok( my $category = $strix->category( $url ), "category $url" );
# Line 39  ok( $layout->{free}, 'free' ); Line 56  ok( $layout->{free}, 'free' );
56    
57  ok( my @sites = $strix->sites, "sites" );  ok( my @sites = $strix->sites, "sites" );
58  diag dump( @sites ) if $debug;  diag dump( @sites ) if $debug;
59    
60    ok( my $nav = $strix->site_navigation( 1, 1 ), "site_navigation" );
61    diag dump( $nav ) if $debug;
62    
63    ok( my $nav2 = $strix->site_navigation( 1, 1 ), "site_navigation (again)" );
64    is_deeply( $nav, $nav2, 'same' );

Legend:
Removed from v.212  
changed lines
  Added in v.213

  ViewVC Help
Powered by ViewVC 1.1.26