class Capybara::RackTest::Form::NilUploadedFile

which should probably be provided to Rack::Test in its non-GET request methods.
That check should be based solely on the form element’s ‘enctype’ attribute value,
the class specifically when determining whether to construct the request as multipart.
This only needs to inherit from Rack::Test::UploadedFile because Rack::Test checks for

def append_to(_); end

def append_to(_); end

def content_type; 'application/octet-stream'; end

def content_type; 'application/octet-stream'; end

def initialize # rubocop:disable Lint/MissingSuper

rubocop:disable Lint/MissingSuper
def initialize # rubocop:disable Lint/MissingSuper
  @empty_file = Tempfile.new('nil_uploaded_file')
  @empty_file.close
end

def original_filename; ''; end

def original_filename; ''; end

def path; @empty_file.path; end

def path; @empty_file.path; end

def read; ''; end

def read; ''; end

def set_encoding(_); end # rubocop:disable Naming/AccessorMethodName

rubocop:disable Naming/AccessorMethodName
def set_encoding(_); end # rubocop:disable Naming/AccessorMethodName

def size; 0; end

def size; 0; end