Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Redirecting TestRunner output from console to file

Reply
Thread Tools

Redirecting TestRunner output from console to file

 
 
Vadim Dobrovolsky
Guest
Posts: n/a
 
      05-06-2009
Hi guys

I'm novice both in Ruby and test/unit, so keep it in mind.

I have the following question:
How can I redirect the Test Runner output from console to some file or
string variable?

E.g.
I run tests with the following arguments

io=File.new('results.txt', 'w')
tr=Test::Unit::UI::Console::TestRunner.new(Testcas e,"VERBOSE",io)

So Test IO should write to io variable but indeed it doesn't contain any
test results.
Ruby global variable $stdout is also empty. So it seems strange for me.

If you know what's wrong with my code and assumptions or some other way
how to get test results please answear.

Thank you in advance.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Ryan Davis
Guest
Posts: n/a
 
      05-06-2009

On May 6, 2009, at 04:45 , Vadim Dobrovolsky wrote:

> Hi guys
>
> I'm novice both in Ruby and test/unit, so keep it in mind.
>
> I have the following question:
> How can I redirect the Test Runner output from console to some file or
> string variable?
>
> E.g.
> I run tests with the following arguments
>
> io=File.new('results.txt', 'w')
> tr=Test::Unit::UI::Console::TestRunner.new(Testcas e,"VERBOSE",io)


Do the simplest thing that could possibly work:

% ruby -Ilib test/test_blah.rb > results.txt


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirecting output from console programs drhilbert C++ 7 07-07-2008 03:55 PM
Redirecting output from console programs hilbert00 C++ 0 07-06-2008 10:02 AM
colorized Test::Unit console testrunner Martin Ankerl Ruby 3 09-16-2004 10:54 PM
Creating a unittest TestRunner Edward Diener Python 0 09-05-2004 12:41 AM
Patch for lib/test/unit/ui/gtk/testrunner.rb Michael Neumann Ruby 2 11-11-2003 03:49 PM



Advertisments