Closed kyledecot closed 6 years ago
Not sure why you closed this, but GLI only uses STDERR
directly in the scaffold script. There is a hidden but public method that lets you change the error device (which does default to STDERR
):
AppSupport
is mixed into your GLI app, so you can call this if you like.
To test stuff like this, though, I would run the actual app and use Open3 to capture the stderr if possible.
I noticed that this method is using
STDERR
instead of$stderr
. This becomes a problem when attempting to capture the output of arun
command that has aexit_now!
call in it.In my case I was attempting to do something like:
cli.rb
cli_spec.rb
As you can see I was attempting to redirect/capture
$stderr
(which I assigned to aStringIO
instance) however this didn't work as expected asoutput_error_message
was using the regular 'olstderr
.