aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/uploaded_file_test.rb
diff options
context:
space:
mode:
authorTim Linquist <tim.linquist@gmail.com>2014-04-15 11:05:08 -0700
committerTim Linquist <tim.linquist@gmail.com>2014-04-15 11:05:08 -0700
commite601728dceb779b6b2aae800c66eb8b3f20f9aaa (patch)
tree847f6c16e524ca990aee6113c3d67b9a3cdd8dd8 /actionpack/test/dispatch/uploaded_file_test.rb
parent43f525031ad3f83a04f84e79bbe1de340bf937aa (diff)
downloadrails-e601728dceb779b6b2aae800c66eb8b3f20f9aaa.tar.gz
rails-e601728dceb779b6b2aae800c66eb8b3f20f9aaa.tar.bz2
rails-e601728dceb779b6b2aae800c66eb8b3f20f9aaa.zip
Provide interface for accessing underlying IO object
In some cases users may need to work with/manipulate more of the Tempfile api than provided by Upload. Allow users to get at the underlying io via the common to_io method of IO/IO-like objects
Diffstat (limited to 'actionpack/test/dispatch/uploaded_file_test.rb')
-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 72f3d1db0d..2a58dadcf6 100644
--- a/actionpack/test/dispatch/uploaded_file_test.rb
+++ b/actionpack/test/dispatch/uploaded_file_test.rb
@@ -33,6 +33,12 @@ module ActionDispatch
assert_equal 'foo', uf.tempfile
end
+ def test_delegates_to_io_to_tempfile
+ tf = Object.new
+ uf = Http::UploadedFile.new(:tempfile => tf)
+ assert_equal tf, uf.to_io
+ end
+
def test_delegates_path_to_tempfile
tf = Class.new { def path; 'thunderhorse' end }
uf = Http::UploadedFile.new(:tempfile => tf.new)