Test::Output can help. For example (untested):
use strict; use warnings; use Test::More tests => 2; use Test::Output; my $status = Status->new(); stdout_is { $status->status('good') } "good status\n"; stdout_is { $status->status('bad') } "bad status\n";
In reply to Re: How do you Test that the right output got printed?
by adrianh
in thread How do you Test that the right output got printed?
by tphyahoo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |