Methods
O
P
R
T
Instance Public methods
open()
# File actionpack/test/dispatch/uploaded_file_test.rb, line 45
def open; 'thunderhorse' end
path()
# File actionpack/test/dispatch/uploaded_file_test.rb, line 39
def path; 'thunderhorse' end
read()
# File actionpack/test/dispatch/uploaded_file_test.rb, line 51
def read; 'thunderhorse' end
test_constructor_with_argument_error()
# File actionpack/test/dispatch/uploaded_file_test.rb, line 5
def test_constructor_with_argument_error
  assert_raises(ArgumentError) do
    Http::UploadedFile.new({})
  end
end
test_content_type()
# File actionpack/test/dispatch/uploaded_file_test.rb, line 23
def test_content_type
  uf = Http::UploadedFile.new(:type => 'foo', :tempfile => Object.new)
  assert_equal 'foo', uf.content_type
end
test_delegate_respects_respond_to?()
# File actionpack/test/dispatch/uploaded_file_test.rb, line 62
    def test_delegate_respects_respond_to?
      tf = Class.new { def read; yield end; private :read }
      uf = Http::UploadedFile.new(:tempfile => tf.new)
      assert_raises(NoMethodError) do
        uf.read
      end
    end

    def test_respond_to?
      tf = Class.new { def read; yield end }
      uf = Http::UploadedFile.new(:tempfile => tf.new)
      assert uf.respond_to?(:headers), 'responds to headers'
      assert uf.respond_to?(:read), 'responds to read'
    end
  end
end
test_delegates_open_to_tempfile()
# File actionpack/test/dispatch/uploaded_file_test.rb, line 44
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
test_delegates_path_to_tempfile()
# File actionpack/test/dispatch/uploaded_file_test.rb, line 38
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
test_delegates_to_tempfile()
# File actionpack/test/dispatch/uploaded_file_test.rb, line 50
def test_delegates_to_tempfile
  tf = Class.new { def read; 'thunderhorse' end }
  uf = Http::UploadedFile.new(:tempfile => tf.new)
  assert_equal 'thunderhorse', uf.read
end
test_delegates_to_tempfile_with_params()
# File actionpack/test/dispatch/uploaded_file_test.rb, line 56
def test_delegates_to_tempfile_with_params
  tf = Class.new { def read *args; args end }
  uf = Http::UploadedFile.new(:tempfile => tf.new)
  assert_equal %w{ thunder horse }, uf.read(*%w{ thunder horse })
end
test_filename_should_be_in_utf_8()
# File actionpack/test/dispatch/uploaded_file_test.rb, line 17
def test_filename_should_be_in_utf_8
  uf = Http::UploadedFile.new(:filename => 'foo', :tempfile => Object.new)
  assert_equal "UTF-8", uf.original_filename.encoding.to_s
end
test_headers()
# File actionpack/test/dispatch/uploaded_file_test.rb, line 28
def test_headers
  uf = Http::UploadedFile.new(:head => 'foo', :tempfile => Object.new)
  assert_equal 'foo', uf.headers
end
test_original_filename()
# File actionpack/test/dispatch/uploaded_file_test.rb, line 11
def test_original_filename
  uf = Http::UploadedFile.new(:filename => 'foo', :tempfile => Object.new)
  assert_equal 'foo', uf.original_filename
end
test_respond_to?()
# File actionpack/test/dispatch/uploaded_file_test.rb, line 70
  def test_respond_to?
    tf = Class.new { def read; yield end }
    uf = Http::UploadedFile.new(:tempfile => tf.new)
    assert uf.respond_to?(:headers), 'responds to headers'
    assert uf.respond_to?(:read), 'responds to read'
  end
end
test_tempfile()
# File actionpack/test/dispatch/uploaded_file_test.rb, line 33
def test_tempfile
  uf = Http::UploadedFile.new(:tempfile => 'foo')
  assert_equal 'foo', uf.tempfile
end