added test file
[webpac2] / t / 5-output-dbi.t
1 #!/usr/bin/perl -w
2
3 use strict;
4 use lib 'lib';
5
6 use Test::More tests => 6;
7
8 BEGIN {
9         use lib 'lib';
10         use_ok( 'WebPAC::Test' );
11         use_ok( 'WebPAC::Output::DBI' );
12 }
13
14 ok(my $out = new WebPAC::Output::DBI({
15         dsn => 'dbi:Pg:dbname=webpac2',
16         schema => "$abs_path/conf/schema.sql",
17         %LOG
18 }), "new");
19
20 ok( $out->init, 'init' );
21
22 my $ds = { '_rows' => {
23         'test' => [
24                 { foo => 42 },
25                 { foo => 1, bar => 11 },
26                 { foo => 99, baz => 'text' },
27         ],
28 } };
29
30 ok( $out->add( 42, $ds ), 'add 42' );
31
32 ok( $out->finish, 'finish' );
33