[rspec-users] Can you control $stdout when specs are running?

GregD gditrick at fuse.net
Thu Sep 30 11:06:36 EDT 2010


Hi all,

I'm testing java classed using rspec and jruby.  The java super class
is trapping an exception and sending a custom message to stdout along
with the original exception meaasage.  The original exception is a
SAXParseException, if that really matters.  Well, my test is to see if
the child object class can handle a garbled XML message a certain
way.   The test passes, but I get the nasty java exception stuff that
is being sent to stdout when the tests are running, yuk.  I tried
closing and opening stdout before and after that particular test and
that did not work or I did it wrong.  And I'm not sure this is
desirable if the test fails.   Any ideas on this other than to replace
the java with ruby or have the java not to dump to stdout?  ;-)   Both
of which, I can not do.  But, I can live with the nastiness of this,
if there is no possible way around it.

Thanks,

GregD


More information about the rspec-users mailing list