I'm writing a convenience module that makes it easy to add debugging output to quick scripts. I'd like to make some tests ala Test::More and I'm wondering what's the best way to test based on the printed or warned output from a module?
Can I do something like E.G.:
... or something similer... possibly better....?grab_stdout($foo); print 'gabba gabba hey'; ungrab_stdout(); ok($foo eq 'gabba gabba hey`) || diag "didn't print 'gabba gabba hey' to stdout.";
Basically, I want to test if the stuff I wanted to send to stdout/stderr did in fact go to stout/stderr.
Thanks!
-Pileofrogs
In reply to Testing a module's stdout/stderr by pileofrogs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |