NAME
Test::Builder2::AssertRecord - Record an assert happening
SYNOPSIS
use Test::Builder2::AssertRecord;
my $record = Test::Builder2::AssertRecord->new;
my $record = Test::Builder2::AssertRecord->new_from_caller($level);
# All the stuff from caller
my $package = $record->package;
my $filename = $record->filename;
my $line = $record->line;
DESCRIPTION
Records where an assert was called.
Useful for diagnostics and stack traces.
Constructors
new
my $record = Test::Builder2::AssertRecord->new({
package => $package,
line => $line,
filename => $filename,
subroutine => $subroutine
});
The normal Mouse constructor. You must supply all the caller information manually.
You should use new_from_caller
.
new_from_caller
my $record = Test::Builder2::AssertRecord->new_from_caller($level);
Constructs an AssertRecord for you by calling caller() at the given $level above your call in the call stack.
Accessors
These are all read-only and act in the expected manner.
filename
The filename from which the asset was called.
line
The line where the assert was called.
package
The class or package in which the assert was called.
subroutine
The fully qualified name of the assert being called.