TB2::AssertRecord - Record an assert happening
use TB2::AssertRecord; my $record = TB2::AssertRecord->new; my $record = TB2::AssertRecord->new_from_caller($level); # All the stuff from caller my $package = $record->package; my $filename = $record->filename; my $line = $record->line;
Records where an assert was called.
Useful for diagnostics and stack traces.
my $record = TB2::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 = TB2::AssertRecord->new_from_caller($level);
Constructs an AssertRecord for you by calling caller() at the given $level above your call in the call stack.
my $record = TB2::AssertRecord->new_from_guess; my $record = TB2::AssertRecord->new_from_guess(@ignore_packages);
Constructs an AssertRecord for you by looking up the call stack until it is out of the calling class.
If @ignore_packages is given, those are also to be ignored when looking up the stack.
These are all read-only and act in the expected manner.
The filename from which the asset was called.
The line where the assert was called.
The class or package in which the assert was called.
The fully qualified name of the assert being called.
To install Test::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Simple
CPAN shell
perl -MCPAN -e shell install Test::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.