X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2Flocal-lib.git;a=blobdiff_plain;f=t%2Fclassmethod.t;h=c066ca195cbb40cbeda0407a57c4a23714fe02a7;hp=385572a888a773ed2c30a453aed7d8eef75c6cd6;hb=ac3d09d610a83d54ae669f514b75d330df30da11;hpb=e322149ff77f5c6255286f89ddfcbefe62b331a2 diff --git a/t/classmethod.t b/t/classmethod.t index 385572a..c066ca1 100644 --- a/t/classmethod.t +++ b/t/classmethod.t @@ -1,33 +1,25 @@ - use strict; use warnings; -use Test::More 'no_plan'; -use local::lib (); +use Test::More tests => 4;; +use File::Temp; +use local::lib (); my $c = 'local::lib'; - { - -is($c->resolve_empty_path, '~/perl5'); -is($c->resolve_empty_path('foo'), 'foo'); - + is($c->resolve_empty_path, '~/perl5'); + is($c->resolve_empty_path('foo'), 'foo'); } { - -local *File::Spec::rel2abs = sub { shift; 'FOO'.shift; }; -is($c->resolve_relative_path('bar'),'FOObar'); - + no warnings 'once'; + local *File::Spec::rel2abs = sub { shift; 'FOO'.shift; }; + is($c->resolve_relative_path('bar'),'FOObar'); } { - -File::Path::rmtree('t/var/splat'); - -$c->ensure_dir_structure_for('t/var/splat'); - -ok(-d 't/var/splat'); - + my $dir = File::Temp::tempdir(); + $c->ensure_dir_structure_for("$dir/splat"); + ok(-d "$dir/splat"); }