X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=t%2F5-output-webpacus.t;h=bc12cc5e8e4bc024e07ed18292870232541d2bb1;hb=6d4f4e4344ff7f46057a759a337a6bc61127ae8e;hp=11c6a12b1bd6ab1a0ef9ace09dc2ab48e881f6d8;hpb=af0dcffdc5f46d7a1f5215d33875927dd435b9a1;p=webpac2 diff --git a/t/5-output-webpacus.t b/t/5-output-webpacus.t index 11c6a12..bc12cc5 100755 --- a/t/5-output-webpacus.t +++ b/t/5-output-webpacus.t @@ -1,30 +1,26 @@ #!/usr/bin/perl -w -use Test::More tests => 10; -use Test::Exception; -use Cwd qw/abs_path/; -use Data::Dump qw/dump/; -use blib; use strict; +use blib; + +use Test::More tests => 11; BEGIN { +use_ok( 'WebPAC::Test' ); use_ok( 'WebPAC::Output::Webpacus' ); } -my $debug = shift @ARGV; - -ok(my $abs_path = abs_path($0), "abs_path"); -$abs_path =~ s#/[^/]*$#/#; # -diag "abs_path: $abs_path"; -my $path = "$abs_path/sorted/"; - ok(my $out = new WebPAC::Output::Webpacus({ path => '/data/Webpacus2/', database => 'test', clean => 1, - debug => $debug, + %LOG }), "new"); +ok( $out->consume_outputs, 'consume_outputs' ); + +diag "consume_outputs = ",dump( $out->consume_outputs ) if $debug; + ok( $out->init, 'init' ); my $ds = { @@ -49,7 +45,7 @@ ok( $out->add( 99, { foo => { sorted => 'bar' } } ), 'add 99' ); ok( $out->add( 100, { foo => { sorted => [ qw/foo bar baz/ ] } } ), 'add 100' ); -diag "path: ",$out->path; +diag "path: ",$out->path if $debug; -ok( $out->finish, 'finish' ); +cmp_ok( $out->finish, '==', 4, 'finish' );