X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=t%2F5-output-sorted.t;h=4d8ee9efcbb15f746c694d5f7480a3e39b7540ab;hb=HEAD;hp=8b73bf644cf311fb858cff997fea4124dc9a2285;hpb=453d215904eb876391040e140540537d7455d40c;p=webpac2 diff --git a/t/5-output-sorted.t b/t/5-output-sorted.t index 8b73bf6..4d8ee9e 100755 --- a/t/5-output-sorted.t +++ b/t/5-output-sorted.t @@ -1,28 +1,22 @@ #!/usr/bin/perl -w -use Test::More tests => 16; -use Test::Exception; -use Cwd qw/abs_path/; -use Data::Dump qw/dump/; -use blib; use strict; +use lib 'lib'; + +use Test::More tests => 16; BEGIN { +use_ok( 'WebPAC::Test' ); 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, - debug => $debug, + %LOG }), "new"); ok( $out->init, 'init' ); @@ -51,7 +45,7 @@ ok( $out->add( 100, { foo => { sorted => [ qw/foo bar baz/ ] } } ), 'add 100' ); 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' );