Skip to content

Instantly share code, notes, and snippets.

Created December 20, 2010 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/748732 to your computer and use it in GitHub Desktop.
Save anonymous/748732 to your computer and use it in GitHub Desktop.
support base perl pods
diff --git a/lib/Mojolicious/Plugin/PodRenderer.pm b/lib/Mojolicious/Plugin/PodRenderer.pm
index 887dc6e..41b8599 100644
--- a/lib/Mojolicious/Plugin/PodRenderer.pm
+++ b/lib/Mojolicious/Plugin/PodRenderer.pm
@@ -58,7 +58,7 @@ sub register {
$module =~ s/\//\:\:/g;
# Path
- my $path = Pod::Simple::Search->new->find($module);
+ my $path = Pod::Simple::Search->new->find($module, map { $_, "$_/pods" } @INC);
# Redirect to CPAN
my $cpan = 'http://search.cpan.org/perldoc';
diff --git a/t/mojolicious/pod_renderer_lite_app.t b/t/mojolicious/pod_renderer_lite_app.t
index b016cfa..df17559 100644
--- a/t/mojolicious/pod_renderer_lite_app.t
+++ b/t/mojolicious/pod_renderer_lite_app.t
@@ -9,7 +9,7 @@ BEGIN { $ENV{MOJO_POLL} = 1 }
use Test::More;
plan skip_all => 'Perl 5.10 required for this test!'
unless eval { require Pod::Simple::HTML; 1 };
-plan tests => 16;
+plan tests => 22;
# Amy get your pants back on and get to work.
# They think were making out.
@@ -53,6 +53,13 @@ $t->get_ok('/perldoc?Mojolicious')->status_is(200)
->text_is('a[name="handler"]', 'handler')->text_like('p', qr/Mojolicious/)
->content_like(qr/Sebastian\ Riedel/);
+# Perldoc browser
+$t->get_ok('/perldoc?perlboot')->status_is(200)
+ ->text_is('h1 a[name="NAME"]', 'NAME')
+ ->text_is('a[name="The_SUPER_way_of_doing_things"]', 'The SUPER way of doing things')->text_like('p', qr/perlboot \- Beginner's Object-Oriented Tutorial/)
+ ->content_like(qr/More interesting instances/);
+
+
__DATA__
@@ index.html.ep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment