James Gray
8/4/2006 7:20:00 PM
On Aug 4, 2006, at 1:40 PM, Tomasz Wegrzanowski wrote:
> By the way how are people usually testing the convenience functions
> that print something to STDOUT.
Use the standard StringIO library for this. You can swap out the
STDOUT object for the test and replace it when you are done but I
prefer to modify the method to be more testable:
def meth_to_test(io = STDOUT)
# use io here...
end
Then you can just pass the StringIO object when testing.
James Edward Gray II