1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
puma--puma/test/testhelp.rb
zedshaw 7b53a9afd2 Improved test coverage of the Command system and a simple method of stuffing useless IO to a file.
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@212 19e92222-5c0b-0410-8929-a290d50e31e9
2006-05-24 08:34:17 +00:00

13 lines
233 B
Ruby

def redirect_test_io
orig_err = STDERR.dup
orig_out = STDOUT.dup
STDERR.reopen("test_stderr.log")
STDOUT.reopen("test_stdout.log")
begin
yield
ensure
STDERR.reopen(orig_err)
STDOUT.reopen(orig_out)
end
end