in reply to How do you Test that the right output got printed?
Like jeffa said, you want status to return a value instead of printing. This not only makes it better for testing, but it's better OO practice in general. What if some time along the line, somebody wants to subclass your class, and wants to know the status. You're forcing them to print it out, but if you just return a value, then it's useable to them. Also it's not too much difficult, and more clear, to write:
print $status->status('good'); # instead of $status->status('good');
-Bryan
|
|---|