move repository to https://github.com/Perl-Toolchain-Gang/local-lib
[p5sagit/local-lib.git] / t / classmethod.t
CommitLineData
4c375968 1use strict;
2use warnings;
aa345cc9 3use Test::More tests => 5;
ac3d09d6 4use File::Temp;
7487778d 5
4c375968 6use local::lib ();
7
4c375968 8my $c = 'local::lib';
9
4c375968 10{
e7ffbae6 11 is($c->resolve_empty_path, '~/perl5');
12 is($c->resolve_empty_path('foo'), 'foo');
4c375968 13}
14
15{
e7ffbae6 16 no warnings 'once';
17 local *File::Spec::rel2abs = sub { shift; 'FOO'.shift; };
18 is($c->resolve_relative_path('bar'),'FOObar');
4c375968 19}
20
21{
aa345cc9 22 my $warn = '';
23 local $SIG{__WARN__} = sub { $warn .= $_[0] };
ac3d09d6 24 my $dir = File::Temp::tempdir();
25 $c->ensure_dir_structure_for("$dir/splat");
26 ok(-d "$dir/splat");
aa345cc9 27 like($warn, qr/^Attempting to create directory/);
4c375968 28}