Test::More::Prefix - Prefix some test output
version 0.007
Inject a prefix in to Test::Builder's informational output. Useful for providing context in noisy and repetitive tests
use Test::More; use Test::More::Prefix qw/test_prefix/; note "Bar"; # Print '# Bar' test_prefix("Foo"); note "Baz"; # Print '# Foo: Baz' test_prefix(''); note "Bat"; # Print '# Bat'
For versions of Test::Simple which use the original Test::Builder underneath, intercepts calls to Test::Builder's internal _print_comment command and adds your prefix to all defined lines.
_print_comment
For versions of Test::Simple which use this new-fangled Test::Stream stuff, we wrap setting of TB2::Event::Log's message attribute to prepend the prefix. This means that more of the possible output contains the prefix.
message
Set the prefix. Accepts a string.
Peter Sergeant - pete@clueball.com on behalf of Net-A-Porter.
pete@clueball.com
To install Test::More::Prefix, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::More::Prefix
CPAN shell
perl -MCPAN -e shell install Test::More::Prefix
For more information on module installation, please visit the detailed CPAN module installation guide.