Re: Testing Output and Functionality

Jed Lund <[email protected]>
Newsgroups gmane.comp.lang.perl.quality-assurance
Message-ID <CAM4-=+Ny2Pvt_AWfb=RARaiy+oyfcP3cjgndqvGOKQVAdZK6Ng@mail.gmail.com>
David,

Thank you for your suggestion.  I haven't gone down that road yet so I will
try it.

Best Regards,

Jed

On Tue, Apr 24, 2012 at 4:07 AM, David Golden <[email protected]> wrote:

> On Tue, Apr 24, 2012 at 12:35 AM, Jed Lund <[email protected]> wrote:
> > I understand that this is a fairly basic question but I am stuck trying
> to
> > find the right path forward.
>
> It's not entirely basic, because you're testing an array of three
> "outputs" for each functionality test instead of just one.
>
> I'd probably use Capture::Tiny:
>
>    use Capture::Tiny qw/capture/;
>
>    my ($out, $err, $result) = capture { your_code_here };
>    # then test $out, $err, $result however you want
>
> If that's repetitive, stick it in a loop or write a function to
> abstract testing the three results against your expectations.
>
> -- David
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.