App::SimpleScan::Plugin::Plaintext - check a page's text without markup
This document describes App::SimpleScan::Plugin::Plaintext version 1.00
# Normal test specs use the entire HTML text http://perl.org/ /books<\/a>\n \| / Y Sites list HTML # If we want to match just the text, not the HTML: %%plaintext on http://perl.org/ /|books \| dev \| history \| jobs/ Y Literal list # And we can turn this back off again: %%plaintext off
This plugin adds the %%plaintext pragma. This allows you to write test specs that match the visible text on a page, as opposed to the HTML text. This is useful if you want to make sure (for instance) if specific text is on the page, but you don't care how it's marked up.
%%plaintext
Exports the %%plaintext pragma handler to App::SimpleScan.
App::SimpleScan
Actually handles the pragma statement. Calls the exported plaintext method to record the current state (on or off).
plaintext
Standard App::SimpleScan callback; returns the code filters.
If the plaintext method returns true, we alter the tests to use text_like and text_unlike instead of page_like and page_unlike. In eitehr case, we return the code to the caller (standard interface).
Invalid argument for %%plaintext: %s
You supplied an argument other than '1' or 'on' to turn plaintext processing on, or '0' or 'off' to turn it off.
App::SimpleScan::Plugin::Plaintext requires no configuration files or environment variables.
App::SimpleScan, Class:Accessot::Fast.
None reported.
No bugs have been reported.
Please report any bugs or feature requests to bug-app-simplescan-plugin-plaintext@rt.cpan.org, or through the web interface at http://rt.cpan.org.
bug-app-simplescan-plugin-plaintext@rt.cpan.org
Joe McMahon <mcmahon@cpan.org>
<mcmahon@cpan.org>
Copyright (c) 2006, Joe McMahon <mcmahon@cpan.org> and Yahoo!. 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.
To install App::SimpleScan::Plugin::Plaintext, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::SimpleScan::Plugin::Plaintext
CPAN shell
perl -MCPAN -e shell install App::SimpleScan::Plugin::Plaintext
For more information on module installation, please visit the detailed CPAN module installation guide.