2009-01-21 Here’s how we create multipart uploads in our test suite for testing with Sinatra 0.3, similar to the post_it test helper method: def upload_it(path, params, rack_opts, file) @request = Rack::MockRequest.new(Sinatra.build_application) opts = normalize_rack_environment(opts) input = FiveRuns::Multipart::FileUpload.new(file, params) opts[:input] ||= input.to_s opts['CONTENT_TYPE'] = input