NAME

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

VERSION

version 0.003

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

TB2

For versions of Test::Simple > 1 which use this new-fangled TB2 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.