MooX-Cmd

 view release on metacpan or  search on metacpan

lib/MooX/Cmd/Tester.pm  view on Meta::CPAN

}

{
    ## no critic qw(ProhibitMultiplePackages)
    package    # no-index
      MooX::Cmd::Tester::Result;

    sub new
    {
        my ($class, $arg) = @_;
        bless $arg => $class;
    }
}

my $res = Package::Stash->new("MooX::Cmd::Tester::Result");
for my $attr (qw(app cmd stdout stderr output error execute_rv exit_code))
{
    $res->add_symbol('&' . $attr, sub { $_[0]->{$attr} });
}

{
    ## no critic qw(ProhibitMultiplePackages)
    package    # no-index
      MooX::Cmd::Tester::Exited;

    sub throw
    {
        my ($class, $code) = @_;
        defined $code or $code = 0;
        my $self = (bless \$code => $class);
        ## no critic qw(RequireCarping)
        die $self;
    }
}

=head1 NAME

MooX::Cmd::Tester - MooX cli app commands tester

=head1 SYNOPSIS

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.911 second using v1.00-cache-2.02-grep-82fe00e-cpan-1925d2aa809 )