projects
/
webpac2
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r1579@llin: dpavlin | 2007-11-10 11:59:27 +0100
[webpac2]
/
t
/
5-output-webpacus.t
diff --git
a/t/5-output-webpacus.t
b/t/5-output-webpacus.t
index
11c6a12
..
bc12cc5
100755
(executable)
--- a/
t/5-output-webpacus.t
+++ b/
t/5-output-webpacus.t
@@
-1,30
+1,26
@@
#!/usr/bin/perl -w
#!/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 strict;
+use blib;
+
+use Test::More tests => 11;
BEGIN {
BEGIN {
+use_ok( 'WebPAC::Test' );
use_ok( 'WebPAC::Output::Webpacus' );
}
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,
ok(my $out = new WebPAC::Output::Webpacus({
path => '/data/Webpacus2/',
database => 'test',
clean => 1,
- debug => $debug,
+ %LOG
}), "new");
}), "new");
+ok( $out->consume_outputs, 'consume_outputs' );
+
+diag "consume_outputs = ",dump( $out->consume_outputs ) if $debug;
+
ok( $out->init, 'init' );
my $ds = {
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' );
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' );