}
}
-=for test pipeline
+=begin testing
+
+#:: test pipeline
package local::lib;
my $foo = bless({}, 'Foo');
Test::More::ok($foo->${pipeline qw(foo bar baz)}(10) == -15);
+=end testing
+
=cut
sub resolve_path {
}
}
-=for test classmethod setup
+=begin testing
+
+#:: test classmethod setup
my $c = 'local::lib';
-=cut
+=end testing
+
+=begin testing
-=for test classmethod
+#:: test classmethod
is($c->resolve_empty_path, '~/perl5');
is($c->resolve_empty_path('foo'), 'foo');
+=end testing
+
=cut
sub resolve_home_path {
File::Spec->rel2abs($path);
}
-=for test classmethod
+=begin testing
+
+#:: test classmethod
local *File::Spec::rel2abs = sub { shift; 'FOO'.shift; };
is($c->resolve_relative_path('bar'),'FOObar');
+=end testing
+
=cut
sub setup_local_lib_for {
)
}
-=for test classmethod
+=begin testing
+
+#:: test classmethod
File::Path::rmtree('t/var/splat');
ok(-f 't/var/splat/.modulebuildrc');
+=end testing
+
=head1 NAME
local::lib - create and use a local lib/ for perl modules with PERL5LIB
sub mode::outer {
shift;
- if (shift =~ /^=for test (\S+)(?:\s+(\S+))?/) {
+ my $line = $_[0];
+ if ($line =~ /^=for test (\S+)(?:\s+(\S+))?/) {
$mode = 'inner';
($test, $segment) = ($1, $2);
$segment ||= '';
$text = '';
+ } elsif ($line =~ /^=begin testing/) {
+ $mode = 'find_comment';
+ ($test, $segment, $text) = ('', '', '');
+ }
+}
+
+sub mode::find_comment {
+ shift;
+ my $line = $_[0];
+ if ($line =~ /^\#\:\: test (\S+)(?:\s+(\S+))?/) {
+ $mode = 'inner';
+ ($test, $segment) = ($1, $2);
+ $segment ||= '';
}
}