class Rack::Test::UploadedFile

def initialize_from_stringio(stringio)

Use the StringIO as the tempfile.
def initialize_from_stringio(stringio)
  raise(ArgumentError, 'Missing `original_filename` for StringIO object') unless @original_filename
  @tempfile = stringio
end