Acme-JavaTrace
view release on metacpan or search on metacpan
t/02hooks.t view on Meta::CPAN
at main::first_caller(${file}:23)
at <eval>(${file}:40)
at main::(${file}:40)
ERRMSG
ok( $die_msg, $errmsg ); #06
package Acme::JavaTrace::Test;
sub TIEHANDLE {
return bless {}, shift
}
sub PRINT {
my $self = shift;
$stderr .= join '', @_;
}
t/03showrefs0.t view on Meta::CPAN
use strict;
use Test::More tests => 4;
use Acme::JavaTrace;
my $text = "Advice from Klortho #11901: You can't just make shit up and expect the computer to know what you mean, Retardo!";
eval {
die bless { type => 'error', text => $text }, 'Exception'
};
isa_ok( $@, 'HASH' );
isa_ok( $@, 'Exception' );
is( $@->{text}, $text, "checking the field text" );
is( $@->{type}, 'error', "checking the field text" );
t/03showrefs1.t view on Meta::CPAN
my $text = "Advice from Klortho #11901: You cant just make shit up and expect the computer to know what you mean, Retardo!";
my @attrs = (
$Data::Dumper::VERSION <= 2.121
? (text => $text)
: (type => 'error', text => $text)
);
eval {
die bless { @attrs }, 'Exception'
};
like( $@,
qq|/^Caught exception object: Exception=HASH\\(0x[0-9a-fA-F]+\\): bless\\( \\{\n|.
qq|\\s+'text' => '\Q$text\E',?\n|.
($Data::Dumper::VERSION <= 2.121 ? '' : qq|\\s+'type' => 'error',?\n|) .
qq|\\}, 'Exception' \\)/|,
"checking the trace"
);
( run in 0.505 second using v1.01-cache-2.11-cpan-de7293f3b23 )