File tree 1 file changed +26
-1
lines changed
1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use strict;
4
4
use warnings;
5
5
use Test::More;
6
6
use Test::Pod::Snippets;
7
+ use With::Roles;
7
8
8
9
my @modules = qw/
9
10
AI::TensorFlow::Libtensorflow
@@ -16,6 +17,30 @@ my @modules = qw/
16
17
17
18
plan tests => 0 + @modules ;
18
19
20
+ package # hide from PAUSE
21
+ Test::Pod::Snippets::Role::PodLocatable {
22
+
23
+ use Moose::Role;
24
+ use Pod::Simple::Search;
25
+
26
+ around _parse => sub {
27
+ my $orig = shift ;
28
+ my ($self , $type , $input ) = @_ ;
29
+
30
+ my $output = eval { $orig -> (@_ ); };
31
+ my $error = $@ ;
32
+ if ( $error =~ / not found in \@ INC/ && $type eq ' module' ) {
33
+ my $pod_file = Pod::Simple::Search-> new-> find($input );
34
+ if ( -f $pod_file ) {
35
+ return $orig -> ($self , ' file' , $pod_file )
36
+ } else {
37
+ die " $error \n Unable to find POD file for $input \n " ;
38
+ }
39
+ }
40
+
41
+ return $output ;
42
+ };
43
+ }
19
44
20
45
package # hide from PAUSE
21
46
My::Test::Pod::Snippets::Parser {
@@ -38,7 +63,7 @@ package # hide from PAUSE
38
63
39
64
for (@modules ) {
40
65
my $parser = My::Test::Pod::Snippets::Parser-> new;
41
- my $tps = Test::Pod::Snippets-> new(
66
+ my $tps = Test::Pod::Snippets-> with::roles( ' +PodLocatable ' ) -> new(
42
67
parser => $parser ,
43
68
);
44
69
$parser -> {tps } = $tps ;
You can’t perform that action at this time.
0 commit comments