projects
/
webpac2
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r1573@llin: dpavlin | 2007-11-08 18:29:03 +0100
[webpac2]
/
t
/
1-config.t
diff --git
a/t/1-config.t
b/t/1-config.t
index
f7ff11e
..
5cad917
100755
(executable)
--- a/
t/1-config.t
+++ b/
t/1-config.t
@@
-1,22
+1,15
@@
#!/usr/bin/perl -w
use strict;
#!/usr/bin/perl -w
use strict;
-use Test::More tests => 12;
-use Test::Exception;
use blib;
use blib;
-use Data::Dump qw/dump/;
-use Cwd qw/abs_path/;
+use Test::More tests => 28;
BEGIN {
BEGIN {
+use_ok( 'WebPAC::Test' );
use_ok( 'WebPAC::Config' );
}
use_ok( 'WebPAC::Config' );
}
-my $debug = shift @ARGV;
-
-ok(my $abs_path = abs_path($0), "abs_path");
-$abs_path =~ s#/[^/]*$#/#;
-
my $path = "$abs_path/conf/test.yml";
ok(my $config = new WebPAC::Config( path => $path ), "new");
my $path = "$abs_path/conf/test.yml";
ok(my $config = new WebPAC::Config( path => $path ), "new");
@@
-40,3
+33,11
@@
my @inputs = $config->webpac('inputs');
diag "inputs = ",dump( @inputs ) if ($debug);
isa_ok(\@inputs, 'ARRAY', "inputs");
cmp_ok(@inputs, '==', 2, "got 2 webpac inputs");
diag "inputs = ",dump( @inputs ) if ($debug);
isa_ok(\@inputs, 'ARRAY', "inputs");
cmp_ok(@inputs, '==', 2, "got 2 webpac inputs");
+
+$config->iterate_inputs(sub {
+ my ($input,$database,$db_config) = @_;
+ isa_ok($input, 'HASH', 'input');
+ ok($database, 'database');
+ isa_ok($db_config, 'HASH', 'database config');
+ isa_ok($input->{normalize}, 'ARRAY', 'normalize');
+});