/[webpac2]/trunk/t/1-config.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 /trunk/t/1-config.t

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

revision 681 by dpavlin, Sun Sep 24 15:28:49 2006 UTC revision 682 by dpavlin, Sun Sep 24 15:28:54 2006 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -w  #!/usr/bin/perl -w
2    
3  use strict;  use strict;
4  use Test::More tests => 8;  use Test::More tests => 12;
5  use Test::Exception;  use Test::Exception;
6  use blib;  use blib;
7    
# Line 19  $abs_path =~ s#/[^/]*$#/#; Line 19  $abs_path =~ s#/[^/]*$#/#;
19    
20  my $path = "$abs_path/conf/test.yml";  my $path = "$abs_path/conf/test.yml";
21    
22  ok(my $c = new WebPAC::Config( path => $path ), "new");  ok(my $config = new WebPAC::Config( path => $path ), "new");
23    
24  cmp_ok($c->{path}, 'eq', $path, "path $path");  cmp_ok($config->{path}, 'eq', $path, "path $path");
25    
26  ok($c->{config}, "config exist");  ok($config->{config}, "config exist");
27    
28  isa_ok($c->databases, 'HASH', "databases");  # $config->databases
   
 my @names = $c->databases;  
29    
30    isa_ok($config->databases, 'HASH', "databases");
31    my @names = $config->databases;
32  isa_ok(\@names, 'ARRAY', "databases names");  isa_ok(\@names, 'ARRAY', "databases names");
   
33  cmp_ok(@names, '==', 3, "got 3 names");  cmp_ok(@names, '==', 3, "got 3 names");
34    isa_ok($config->databases, 'HASH', "databases");
35    
36    diag '$config->webpac = ', dump($config->webpac) if ($debug);
37    
38    isa_ok($config->webpac, 'HASH', "webpac");
39    my @inputs = $config->webpac('inputs');
40    diag "inputs = ",dump( @inputs ) if ($debug);
41    isa_ok(\@inputs, 'ARRAY', "inputs");
42    cmp_ok(@inputs, '==', 2, "got 2 webpac inputs");

Legend:
Removed from v.681  
changed lines
  Added in v.682

  ViewVC Help
Powered by ViewVC 1.1.26