From d964d8966c316fb224e37c3a98345622f3bd0cd7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 2 Apr 2009 19:46:54 -0700 Subject: test_helper: redirect_io uses append and sync In case redirect_io is called multiple times, we don't want to lose debugging output. --- test/test_helper.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test_helper.rb b/test/test_helper.rb index 37625ec..55aa70c 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -35,8 +35,9 @@ end def redirect_test_io orig_err = STDERR.dup orig_out = STDOUT.dup - STDERR.reopen("test_stderr.#{$$}.log") - STDOUT.reopen("test_stdout.#{$$}.log") + STDERR.reopen("test_stderr.#{$$}.log", "a") + STDOUT.reopen("test_stdout.#{$$}.log", "a") + STDERR.sync = STDOUT.sync = true at_exit do File.unlink("test_stderr.#{$$}.log") rescue nil -- cgit v1.2.3-24-ge0c7