MooX-Cmd
view release on metacpan or search on metacpan
lib/MooX/Cmd/Tester.pm view on Meta::CPAN
135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174}
{
## 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.287 second using v1.01-cache-2.11-cpan-e5176c747c2 )