I think that output goes to standard error, so that's what you need to redirect.

I strongly encourage you to take a look at the Test::Unit code and see if you can't create your own test runner that gives you the output you want.

Bret

On 4/25/06, Paul Carvalho <[EMAIL PROTECTED]> wrote:
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.


_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general


_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to