aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJens Fahnenbruck <jigfox@me.com>2011-08-23 21:10:01 +0200
committerPiotr Sarnacki <drogus@gmail.com>2012-03-27 22:53:33 +0200
commit96b72efc001473061e69bda0c601d8bda64027f3 (patch)
treec0ebffd6fef2263b9444c8ad6c95c4c377922d9a /actionpack/test
parente96d04a2e4e244ea5053cb4e8ab97db604d0c796 (diff)
downloadrails-96b72efc001473061e69bda0c601d8bda64027f3.tar.gz
rails-96b72efc001473061e69bda0c601d8bda64027f3.tar.bz2
rails-96b72efc001473061e69bda0c601d8bda64027f3.zip
adds delegetion for eof? to AD::Http::UploadedFile
if you want to read the file you may need to ask if there is something to read from
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/uploaded_file_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/uploaded_file_test.rb b/actionpack/test/dispatch/uploaded_file_test.rb
index 1e3f720fa7..e69c1fbed4 100644
--- a/actionpack/test/dispatch/uploaded_file_test.rb
+++ b/actionpack/test/dispatch/uploaded_file_test.rb
@@ -65,6 +65,12 @@ module ActionDispatch
end
end
+ def test_delegate_eof_to_tempfile
+ tf = Class.new { def eof?; true end; }
+ uf = Http::UploadedFile.new(:tempfile => tf.new)
+ assert uf.eof?
+ end
+
def test_respond_to?
tf = Class.new { def read; yield end }
uf = Http::UploadedFile.new(:tempfile => tf.new)