aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-10-04 16:56:45 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-10-04 16:56:45 -0700
commit2a3022db7f2ddc0fc0e678ea757f97902c5f5c01 (patch)
tree115d29e58d06610d6506afb1fda37c7ecd1f981a /actionpack/test/dispatch
parentf9734f2b0f5326c399d1c1cccba8b6d8e7d9bdd4 (diff)
downloadrails-2a3022db7f2ddc0fc0e678ea757f97902c5f5c01.tar.gz
rails-2a3022db7f2ddc0fc0e678ea757f97902c5f5c01.tar.bz2
rails-2a3022db7f2ddc0fc0e678ea757f97902c5f5c01.zip
delegate to the @tempfile instance variable
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r--actionpack/test/dispatch/uploaded_file_test.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/uploaded_file_test.rb b/actionpack/test/dispatch/uploaded_file_test.rb
index def6289fb3..d04d5a8650 100644
--- a/actionpack/test/dispatch/uploaded_file_test.rb
+++ b/actionpack/test/dispatch/uploaded_file_test.rb
@@ -21,5 +21,23 @@ module ActionDispatch
uf = Http::UploadedFile.new(:tempfile => 'foo')
assert_equal 'foo', uf.tempfile
end
+
+ def test_delegates_to_tempfile
+ tf = Class.new { def tenderlove; 'thunderhorse' end }
+ uf = Http::UploadedFile.new(:tempfile => tf.new)
+ assert_equal 'thunderhorse', uf.tenderlove
+ end
+
+ def test_delegates_to_tempfile_with_params
+ tf = Class.new { def tenderlove *args; args end }
+ uf = Http::UploadedFile.new(:tempfile => tf.new)
+ assert_equal %w{ thunder horse }, uf.tenderlove(*%w{ thunder horse })
+ end
+
+ def test_delegates_to_tempfile_with_block
+ tf = Class.new { def tenderlove; yield end }
+ uf = Http::UploadedFile.new(:tempfile => tf.new)
+ assert_equal('thunderhorse', uf.tenderlove { 'thunderhorse' })
+ end
end
end