Re: [Rails-core] Method capture

Showing 1-5 of 5 messages
Re: [Rails-core] Method capture Aaron Patterson 9/10/12 9:26 AM
On Mon, Sep 10, 2012 at 08:56:12AM -0700, Dmitry Vorotilin wrote:
> Guys I want to ask you about current realization of method capture. There's
> a case in tests where I want to capture output in subprocess, current
> realization cannot do it because it doesn't reopen $std{out,err} and just
> reassign this value. I think that's enough for many cases, do we need
> another realization in reporting.rb? Or I can just place it in the tests.
> It related to

Can you check to see if minitest's `capture_io` will solve the problem?

If not, can you write a small example (outside rails) to demonstrate the
problem?  This sounds like something we might want to push up to
minitest if possible.

Aaron Patterson
Re: [Rails-core] Method capture Dmitry Vorotilin 9/10/12 2:38 PM
Thanks Aaron for reply I write a gist for these cases, here you are
Re: [Rails-core] Method capture Dmitry Vorotilin 9/10/12 2:41 PM
The new method, captures all descriptors, but I'm not sure about replacement original method.
Re: [Rails-core] Method capture Gabriel Sobrinho 9/11/12 6:24 AM

I commented in your gist to use the StringIO instead of Tempfile to avoid IO on disk.
Re: [Rails-core] Method capture Dmitry Vorotilin 9/11/12 9:41 AM
Thank you, let's discuss it in PR
I think it will be more comfortable for us.