Skip to content

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

Open
paultcochrane wants to merge 9 commits intodamil:masterfrom
paultcochrane:pr/add-tests-to-pod-pom-web
Open

Add tests to Pod::POM::Web#18
paultcochrane wants to merge 9 commits intodamil:masterfrom
paultcochrane:pr/add-tests-to-pod-pom-web

Conversation

@paultcochrane
Copy link
Copy Markdown
Contributor

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.

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
requirements.
thus documenting the behaviour for known and unkown search terms.
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.
... 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).
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant