aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/uploaded_file_test.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2012-09-23 00:50:30 +0200
committerXavier Noria <fxn@hashref.com>2012-09-23 00:50:30 +0200
commit133d42bc0fe4926800ff91a587e2ebeb405c3a11 (patch)
tree3817ec6fa700a1803498c240bb58632c93fc2c07 /actionpack/test/dispatch/uploaded_file_test.rb
parent3b0da715c5c8cfc97071c4e640c9e00a2895113a (diff)
downloadrails-133d42bc0fe4926800ff91a587e2ebeb405c3a11.tar.gz
rails-133d42bc0fe4926800ff91a587e2ebeb405c3a11.tar.bz2
rails-133d42bc0fe4926800ff91a587e2ebeb405c3a11.zip
fixes the suite for uploaded files
Diffstat (limited to 'actionpack/test/dispatch/uploaded_file_test.rb')
-rw-r--r--actionpack/test/dispatch/uploaded_file_test.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/test/dispatch/uploaded_file_test.rb b/actionpack/test/dispatch/uploaded_file_test.rb
index f72afe745c..72f3d1db0d 100644
--- a/actionpack/test/dispatch/uploaded_file_test.rb
+++ b/actionpack/test/dispatch/uploaded_file_test.rb
@@ -46,25 +46,25 @@ module ActionDispatch
end
def test_delegates_close_to_tempfile
- tf = Class.new { def close; 'thunderhorse' end }
+ tf = Class.new { def close(unlink_now=false); 'thunderhorse' end }
uf = Http::UploadedFile.new(:tempfile => tf.new)
assert_equal 'thunderhorse', uf.close
end
def test_close_accepts_parameter
- tf = Class.new { def close(optional = false); "thunderhorse: #{optional}" end }
+ tf = Class.new { def close(unlink_now=false); "thunderhorse: #{unlink_now}" end }
uf = Http::UploadedFile.new(:tempfile => tf.new)
assert_equal 'thunderhorse: true', uf.close(true)
end
- def test_delegates_to_tempfile
- tf = Class.new { def read; 'thunderhorse' end }
+ def test_delegates_read_to_tempfile
+ tf = Class.new { def read(length=nil, buffer=nil); 'thunderhorse' end }
uf = Http::UploadedFile.new(:tempfile => tf.new)
assert_equal 'thunderhorse', uf.read
end
- def test_delegates_to_tempfile_with_params
- tf = Class.new { def read *args; args end }
+ def test_delegates_read_to_tempfile_with_params
+ tf = Class.new { def read(length=nil, buffer=nil); [length, buffer] end }
uf = Http::UploadedFile.new(:tempfile => tf.new)
assert_equal %w{ thunder horse }, uf.read(*%w{ thunder horse })
end