class Rack::Test::UploadedFile

def initialize(content, content_type = 'text/plain', binary = false, original_filename: nil)

original_filename :: The filename to use for the file. Required if content is StringIO, optional override if not
binary :: Whether the file should be set to binmode (content treated as binary).
content_type :: MIME type of the file
content :: is a path to a file, or an {IO} or {StringIO} object representing the content.
Arguments:

Creates a new UploadedFile instance.
def initialize(content, content_type = 'text/plain', binary = false, original_filename: nil)
  @content_type = content_type
  @original_filename = original_filename
  case content
  when StringIO
    initialize_from_stringio(content)
  else
    initialize_from_file_path(content)
  end
  @tempfile.binmode if binary
end