Created
December 20, 2010 18:07
-
-
Save anonymous/748732 to your computer and use it in GitHub Desktop.
support base perl pods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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