[rspec-users] How do I get logging with rspec?

Will Sargent will.sargent at gmail.com
Wed Jan 30 16:02:01 EST 2008

Say I'm testing a controller with rspec, and I have logger.debug and
logger.error calls.

Normally I'd like them to write to the appropriate file, but in this
case I'd like to see the output on STDOUT.

Is there an easy way to redirect logging in rspec to do this?

I'm thinking that


should start it off, but then how do I get the new logger to do puts
without defining a new class?  I'm assuming there must be a "Ruby way"
to do it.


More information about the rspec-users mailing list