Carp-Proxy

 view release on metacpan or  search on metacpan

t/20-meth-decipher.t  view on Meta::CPAN

    use Moose;
    extends 'Carp::Proxy';

    #-----
    # Our goal here is to prove that we can override Carp::Proxy's
    # decipher_child_error() by sub-classing.
    #-----
    sub decipher_child_error {
        my( $self ) = @_;

        $self->fixed('decoded');
        return;
    }
    no Moose;
    __PACKAGE__->meta->make_immutable;
}

package main;

use Carp::Proxy;
BEGIN{

t/20-meth-decipher.t  view on Meta::CPAN


    #-----
    # This time, instead of invoking 'fatal' we invoke 'fatal1' which
    # is a Proxy from a sub-class that overrides identifier_presentation().
    # The handler name 'dummy' should expand into ' d u m m y '.
    #-----
    throws_ok{ fatal1 'handler' }
        qr{
              ^
              \Q  *** Description ***\E  \r? \n
              \Q    decoded\E            \r? \n
          }xm,
        'Subclassed decipher_child_header() overrides base';
}



( run in 0.447 second using v1.01-cache-2.11-cpan-26ccb49234f )