Peter Sergeant > Test-More-Prefix-0.005 > Test::More::Prefix

Download:
Test-More-Prefix-0.005.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.005   Source  

NAME ^

Test::More::Prefix - Prefix some test output

DESCRIPTION ^

Inject a prefix in to Test::Builder's informational output. Useful for providing context in noisy and repetitive tests

SYNOPSIS ^

 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'

IMPLEMENTATION ^

Test::Builder

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.

Test::Stream

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.

FUNCTIONS ^

test_prefix

Set the prefix. Accepts a string.

AUTHOR ^

Peter Sergeant - pete@clueball.com on behalf of Net-A-Porter.

syntax highlighting: