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
( run in 0.288 second using v1.01-cache-2.11-cpan-bf8d7bb2d05 )