/[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

Annotation of /trunk/t/1-config.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 949 - (hide annotations)
Thu Nov 1 00:16:48 2007 UTC (16 years, 6 months ago) by dpavlin
File MIME type: application/x-troff
File size: 1084 byte(s)
 r1433@llin:  dpavlin | 2007-10-31 22:48:02 +0100
 HUGE swiping changes to implement new testing architecture
 based on all new WebPAC::Test module which makes
 test writing a joy

1 dpavlin 681 #!/usr/bin/perl -w
2    
3     use strict;
4     use blib;
5    
6 dpavlin 949 use Test::More tests => 28;
7 dpavlin 681
8     BEGIN {
9 dpavlin 949 use_ok( 'WebPAC::Test' );
10 dpavlin 681 use_ok( 'WebPAC::Config' );
11     }
12    
13     my $path = "$abs_path/conf/test.yml";
14    
15 dpavlin 682 ok(my $config = new WebPAC::Config( path => $path ), "new");
16 dpavlin 681
17 dpavlin 682 cmp_ok($config->{path}, 'eq', $path, "path $path");
18 dpavlin 681
19 dpavlin 682 ok($config->{config}, "config exist");
20 dpavlin 681
21 dpavlin 682 # $config->databases
22 dpavlin 681
23 dpavlin 682 isa_ok($config->databases, 'HASH', "databases");
24     my @names = $config->databases;
25 dpavlin 681 isa_ok(\@names, 'ARRAY', "databases names");
26 dpavlin 682 cmp_ok(@names, '==', 3, "got 3 names");
27     isa_ok($config->databases, 'HASH', "databases");
28 dpavlin 681
29 dpavlin 682 diag '$config->webpac = ', dump($config->webpac) if ($debug);
30    
31     isa_ok($config->webpac, 'HASH', "webpac");
32     my @inputs = $config->webpac('inputs');
33     diag "inputs = ",dump( @inputs ) if ($debug);
34     isa_ok(\@inputs, 'ARRAY', "inputs");
35     cmp_ok(@inputs, '==', 2, "got 2 webpac inputs");
36 dpavlin 685
37     $config->iterate_inputs(sub {
38 dpavlin 688 my ($input,$database,$db_config) = @_;
39     isa_ok($input, 'HASH', 'input');
40     ok($database, 'database');
41     isa_ok($db_config, 'HASH', 'database config');
42 dpavlin 700 isa_ok($input->{normalize}, 'ARRAY', 'normalize');
43 dpavlin 685 });

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26