Open
Conversation
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.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR extends the test suite to test more of the functionality in the
Pod::POM::Webmodule. 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.tfile, 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.