11 Sep 2006 23:02:28 UTC
- Distribution: App-SimpleScan-Plugin-LinkCheck
- Module version: 1.03
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (0 / 479 / 9)
- KwaliteeBus factor: 1
- 27.11% Coverage
- License: unknown
- Activity24 month
- Download (7.65KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionMCMAHON Joe McMahon
- CONFIGURATION AND ENVIRONMENT
- BUGS AND LIMITATIONS
- LICENCE AND COPYRIGHT
- DISCLAIMER OF WARRANTY
App::SimpleScan::Plugin::LinkCheck - Link counting/presence/absence plugin
This document describes App::SimpleScan::Plugin::LinkCheck version 1.00
# After this plugin is installed: %%has_link 'My stuff' %%no_link 'Send email' # The has_link and no_link checks will run for every test spec. http://someplace.com /foo/ Y Got my page http://someplace.com/subpage /foo/ Y Got my subpage # Stop checking for the 'My stuff' link %%forget_link 'My stuff' # Now only the "no 'Send email' link' test will run. http://someplace.com/map /foo/ Y Get map page # More specific tests can be done: # The page will have exactly one 'home' link %%has_link 'Home' == 1 # The page will have a non-zero number of 'offsite' links. %%has_link 'offsite' > 0 http://someplace.com/links /foo/ Y Get links page # Now both these tests and the 'send email' test will run.
Th Linkcheck plugin adds simple link counting and presence/absence checking pragmas to
simple_scan. These pragmas are assertions; they will be run for every test spec occurring after the pragma(s) appear in the intput file.
You can, for instance, assert that you do not want to see a link named 'Click here' anywhere in the pages referenced by the test specs in this test:
%%no_link 'Click here'
Additional test specs generated by variable substitution will each have the check made, so for example
%%which bar baz quux http://<which>.foo.com /foo.com/ Y Fetch page
would check for /foo.com/ on each of bar.foo.com, baz.foo.com, and quux.foo.com, and also check for zero links whose name is 'Click here' on each of these pages.
Conversely, you can assert that a link must be present on each page you look at:
This means that a link named 'back' must appear on every page you fetch after this pragma occurs in the input.
You may want to remove the condition for some pages in your tests; this can easily be done by 'forgetting' the link:
The assertion has now been dropped, and will not be tested through the rest of the file. If you want to forget all of the currently-active link-count assertions, just use
and all of the link checks will stop.
If you want to be more specific about the link counts, you can use the extended syntax for '%%has_link':
%%has_link 'beta' >= 0 %%has_link 'up' == 2 %%has_link 'report_problems' != 1
Note that you can use any of the numeric operators and a count for this. These work just like the other tests, in that they apply to every test spec following until either the end of the file, or a '%%forget_link' that drops them.
Sets up the initial (empty) link conditions.
Exports the definitions of
Returns list of output filter subs to caller (standard callback).
Determines what (if any) link checks are queued up and stackes them, incrementing the test count appropriately.
%s is not a legal comparison operator (use < > <= >= == !=)
You supplied a comparison operator that wasn't one we expected.
%s doesn't look like a legal number to me
The item you supplied as a count of the number of times you expect to see the link was not something that looks like a number to Perl.
App::SimpleScan::Plugin::LinkCheck requires no configuration files or environment variables.
No bugs have been reported.
Please report any bugs or feature requests to
email@example.com, or through the web interface at http://rt.cpan.org.
Copyright (c) 2006, Yahoo! and Joe McMahon
<firstname.lastname@example.org>. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Module Install Instructions
To install App::SimpleScan::Plugin::LinkCheck, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install App::SimpleScan::Plugin::LinkCheck
For more information on module installation, please visit the detailed CPAN module installation guide.