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

Daniel Browne browne.daniel at gmail.com
Tue Apr 25 11:04:19 EDT 2006


What happens if you do:

    ruby iostring_test.rb > some_file.log

Or to redirect STDOUT and SDTERR to the file try:

    ruby iostring_test.rb > some_file.log 2>&1

Cheers,
Daniel.

On 25/04/06, Paul Carvalho <tester.paul at gmail.com> 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
> Wtr-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>
>




More information about the Wtr-general mailing list