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
/
5-output-sorted.t
diff --git
a/t/5-output-sorted.t
b/t/5-output-sorted.t
index
b43c9be
..
d9b2b61
100755
(executable)
--- a/
t/5-output-sorted.t
+++ b/
t/5-output-sorted.t
@@
-1,28
+1,22
@@
#!/usr/bin/perl -w
#!/usr/bin/perl -w
-use Test::More tests => 13;
-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 => 16;
BEGIN {
BEGIN {
+use_ok( 'WebPAC::Test' );
use_ok( 'WebPAC::Output::Sorted' );
}
use_ok( 'WebPAC::Output::Sorted' );
}
-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::Sorted({
path => $path,
database => 'test',
clean => 1,
my $path = "$abs_path/sorted/";
ok(my $out = new WebPAC::Output::Sorted({
path => $path,
database => 'test',
clean => 1,
- debug => $debug,
+ %LOG
}), "new");
ok( $out->init, 'init' );
}), "new");
ok( $out->init, 'init' );
@@
-51,9
+45,11
@@
ok( $out->add( 100, { foo => { sorted => [ qw/foo bar baz/ ] } } ), 'add 100' );
ok( -e $out->path, "created $path" );
ok( -e $out->path, "created $path" );
-diag $out->path," eq ",$path;
+diag $out->path," eq ",$path
if $debug
;
cmp_ok( $out->path, 'eq', $path, 'path' );
ok( $out->finish, 'finish' );
cmp_ok( $out->path, 'eq', $path, 'path' );
ok( $out->finish, 'finish' );
-ok( -e "$path/test.txt", 'list' );
+foreach my $l ( qw/source id array foo/ ) {
+ ok( -e "$path/$l.txt", "list $l exists" );
+}