MooX-Cmd

 view release on metacpan or  search on metacpan

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

135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
}
 
{
    ## 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 )