diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-18 10:10:18 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-18 10:10:25 -0800 |
commit | c52e2cf4b3ef22fea6989df906a53188e632b9a4 (patch) | |
tree | a360f8418b53e3963e38bfce209e488dd95c208b /actionpack/test/dispatch/uploaded_file_test.rb | |
parent | 26923756fb23eb9c2993a365f9819027f20d5e77 (diff) | |
download | rails-c52e2cf4b3ef22fea6989df906a53188e632b9a4.tar.gz rails-c52e2cf4b3ef22fea6989df906a53188e632b9a4.tar.bz2 rails-c52e2cf4b3ef22fea6989df906a53188e632b9a4.zip |
delegating path and open to internal tempfile
Diffstat (limited to 'actionpack/test/dispatch/uploaded_file_test.rb')
-rw-r--r-- | actionpack/test/dispatch/uploaded_file_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/uploaded_file_test.rb b/actionpack/test/dispatch/uploaded_file_test.rb index b51697b930..e2a7f1bad7 100644 --- a/actionpack/test/dispatch/uploaded_file_test.rb +++ b/actionpack/test/dispatch/uploaded_file_test.rb @@ -28,6 +28,18 @@ module ActionDispatch assert_equal 'foo', uf.tempfile end + def test_delegates_path_to_tempfile + tf = Class.new { def path; 'thunderhorse' end } + uf = Http::UploadedFile.new(:tempfile => tf.new) + assert_equal 'thunderhorse', uf.path + end + + def test_delegates_open_to_tempfile + tf = Class.new { def open; 'thunderhorse' end } + uf = Http::UploadedFile.new(:tempfile => tf.new) + assert_equal 'thunderhorse', uf.open + end + def test_delegates_to_tempfile tf = Class.new { def read; 'thunderhorse' end } uf = Http::UploadedFile.new(:tempfile => tf.new) |