NAME

App::SimpleScan::Plugin::Plaintext - check a page's text without markup

VERSION

This document describes App::SimpleScan::Plugin::Plaintext version 1.00

SYNOPSIS

# 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

DESCRIPTION

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.

INTERFACE

pragmas

Exports the %%plaintext pragma handler to App::SimpleScan.

plaintext_pragma

Actually handles the pragma statement. Calls the exported plaintext method to record the current state (on or off).

filters

Standard App::SimpleScan callback; returns the code filters.

filter

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).

DIAGNOSTICS

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.

CONFIGURATION AND ENVIRONMENT

App::SimpleScan::Plugin::Plaintext requires no configuration files or environment variables.

DEPENDENCIES

App::SimpleScan, Class:Accessot::Fast.

INCOMPATIBILITIES

None reported.

BUGS AND LIMITATIONS

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.

AUTHOR

Joe McMahon <mcmahon@cpan.org>

LICENCE AND COPYRIGHT

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.

DISCLAIMER OF WARRANTY

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.