diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-09-20 10:53:33 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-09-20 10:53:33 +0000 |
commit | 3754822f43f2942f32f14ea326c9a7b2f344d056 (patch) | |
tree | 85d30e927872799646db701ce33344fc7afe1ade /actionpack/test | |
parent | 3c0129af6d045654284f60db26124b9324d2fa94 (diff) | |
download | rails-3754822f43f2942f32f14ea326c9a7b2f344d056.tar.gz rails-3754822f43f2942f32f14ea326c9a7b2f344d056.tar.bz2 rails-3754822f43f2942f32f14ea326c9a7b2f344d056.zip |
Fixed problem with send_file and WEBrick using stdout #1812
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2274 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/send_file_test.rb | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/actionpack/test/controller/send_file_test.rb b/actionpack/test/controller/send_file_test.rb index b7674bda60..0a1cc256d2 100644 --- a/actionpack/test/controller/send_file_test.rb +++ b/actionpack/test/controller/send_file_test.rb @@ -47,16 +47,11 @@ class SendFileTest < Test::Unit::TestCase assert_not_nil response assert_kind_of Proc, response.body - old_stdout = $stdout - begin - require 'stringio' - $stdout = StringIO.new - $stdout.binmode - assert_nothing_raised { response.body.call } - assert_equal file_data, $stdout.string - ensure - $stdout = old_stdout - end + require 'stringio' + output = StringIO.new + output.binmode + assert_nothing_raised { response.body.call(response, output) } + assert_equal file_data, output.string end def test_data |