[Wtr-general] Need Help redirecting the Test Unit output

Paul Carvalho tester.paul at gmail.com
Tue Apr 25 10:48:58 EDT 2006


Hi there, I'm trying to capture the Test Unit output to a file but I'm not
exactly sure of what it is I need to capture.  I thought it was STDOUT, but
now I'm not so sure.  Here's an example of what I want...

In the Watir\Unittests\ folder, run the script: iostring_test.rb

It has the following output:
----
>ruby iostring_test.rb
Loaded suite iostring_test
Started
......
Finished in 0.0 seconds.

6 tests, 7 assertions, 0 failures, 0 errors
>Exit code: 0
----

This script redirects STDOUT (the 'puts' and 'prints') to variables to work
with them in the asserts.  That's neat, but not what I want to do.

What I actually want to do is capture the *above* Test Unit summary output
to a file and ignore everything else.  I want the "Loaded", "Started",
"....", Finish time, and test summary.

I've searched the Watir message archives, googled the web, and skimmed
through the PickAxe book, but so far I haven't been able to figure out how
to do this.  I browsed through some of the code in
C:\ruby\lib\ruby\1.8\test\unit but I haven't deciphered it yet.

Does anyone know how to redirect this Test Unit output?  Are there any
additional sources that I can refer to for changing the Test Unit framework
so that it writes this info to a file?

Paul.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060425/94a7674a/attachment.html 


More information about the Wtr-general mailing list