New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests to Pod::POM::Web #18

wants to merge 9 commits into
base: master


None yet
1 participant

paultcochrane commented Oct 3, 2017

This PR extends the test suite to test more of the functionality in the Pod::POM::Web module. It increases test coverage in this module to 90%. I've split the PR up into several commits so that they can be cherry picked as required. Hopefully this helps with documenting current behaviour and with future refactoring.

I've put the tests into the t/requests.t file, which might not be the best place for them, so if you would like them to be put somewhere else, please just let me know and I'll restructure and resubmit the PR.

paultcochrane added some commits Oct 3, 2017

Add tests of the perlfaq() function
which document the expected behaviour when searching for known and
unknown functions.  `Capture::Tiny` was used to capture the output of
the function, hence this module was added to the list of test
Add tests for the perlvar() function
thus documenting the behaviour for known and unkown search terms.
Add tests for TOC output for perldocs, pragmas etc.
This adds very basic checks for the expected HTML output when producing
tables of contents for perldocs, pragmas, and scripts.  The code has
been wrapped in a subtest so that it can be more easily extended to
other TOC types in the future.
Add tests of serve_script() function
... which now documents the behaviour of the function for when a script
file doesn't exist, when it doesn't contain embedded POD, and when it
does contain embedded POD.  In order to get the code working as intended
in serve_script(), the function itself needed to be extended to check
that the generated full path to the script actually does point to an
existing file (the loop working this out can complete with a defined
`$fullpath` variable, which however doesn't point to an existing file,
hence the error check was never being triggered).
Extend server() function to accept a timeout option
This maintains the current functionality for running a local server, but
also allows the server() function to be tested.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment