Skip to content

Commit

Permalink
better POD tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Dec 4, 2015
1 parent 1ce3882 commit 95b1686
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
@@ -1,4 +1,4 @@
package MojoliciousPODTest;
package MojoliciousTest::PODTest;

1;

Expand Down
16 changes: 8 additions & 8 deletions t/mojolicious/pod_renderer_lite_app.t
Expand Up @@ -56,33 +56,33 @@ $t->get_ok('/art')->status_is(200)->text_like('h2[id="art"]' => qr/art/)
$t->get_ok('/empty')->status_is(200)->content_is('');

# Headings
$t->get_ok('/perldoc/MojoliciousPODTest')->status_is(200)
$t->get_ok('/perldoc/MojoliciousTest/PODTest')->status_is(200)
->element_exists('h1#One')->element_exists('h2#Two')
->element_exists('h3#Three')->element_exists('h4#Four')
->element_exists('a[href=#One]')->element_exists('a[href=#Two]')
->element_exists('a[href=#Three]')->element_exists('a[href=#Four]')
->text_like('pre code', qr/\$foo/);

# Trailing slash
$t->get_ok('/perldoc/MojoliciousPODTest/')->element_exists('#mojobar')
$t->get_ok('/perldoc/MojoliciousTest/PODTest/')->element_exists('#mojobar')
->text_like('title', qr/PODTest/);

# Format
$t->get_ok('/perldoc/MojoliciousPODTest.html')->element_exists('#mojobar')
$t->get_ok('/perldoc/MojoliciousTest/PODTest.html')->element_exists('#mojobar')
->text_like('title', qr/PODTest/);

# Format (source)
$t->get_ok('/perldoc/MojoliciousPODTest' => {Accept => 'text/plain'})
$t->get_ok('/perldoc/MojoliciousTest/PODTest' => {Accept => 'text/plain'})
->status_is(200)->content_type_is('text/plain;charset=UTF-8')
->content_like(qr/package MojoliciousPODTest/);
->content_like(qr/package MojoliciousTest::PODTest/);

# Negotiated source
$t->get_ok('/perldoc/MojoliciousPODTest' => {Accept => 'text/plain'})
$t->get_ok('/perldoc/MojoliciousTest/PODTest' => {Accept => 'text/plain'})
->status_is(200)->content_type_is('text/plain;charset=UTF-8')
->content_like(qr/package MojoliciousPODTest/);
->content_like(qr/package MojoliciousTest::PODTest/);

# Perldoc browser (unsupported format)
$t->get_ok('/perldoc/MojoliciousPODTest.json')->status_is(204);
$t->get_ok('/perldoc/MojoliciousTest/PODTest.json')->status_is(204);

# Welcome
$t->get_ok('/perldoc')->status_is(200)->element_exists('#mojobar')
Expand Down

0 comments on commit 95b1686

Please sign in to comment.