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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 949 - (show 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 #!/usr/bin/perl -w
2
3 use strict;
4 use blib;
5
6 use Test::More tests => 28;
7
8 BEGIN {
9 use_ok( 'WebPAC::Test' );
10 use_ok( 'WebPAC::Config' );
11 }
12
13 my $path = "$abs_path/conf/test.yml";
14
15 ok(my $config = new WebPAC::Config( path => $path ), "new");
16
17 cmp_ok($config->{path}, 'eq', $path, "path $path");
18
19 ok($config->{config}, "config exist");
20
21 # $config->databases
22
23 isa_ok($config->databases, 'HASH', "databases");
24 my @names = $config->databases;
25 isa_ok(\@names, 'ARRAY', "databases names");
26 cmp_ok(@names, '==', 3, "got 3 names");
27 isa_ok($config->databases, 'HASH', "databases");
28
29 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
37 $config->iterate_inputs(sub {
38 my ($input,$database,$db_config) = @_;
39 isa_ok($input, 'HASH', 'input');
40 ok($database, 'database');
41 isa_ok($db_config, 'HASH', 'database config');
42 isa_ok($input->{normalize}, 'ARRAY', 'normalize');
43 });

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26