Sha256: 664ee3b73a8711b9cec1c1769f99183d9f3897409aeffb1d9d1dc929b672c016
Contents?: true
Size: 665 Bytes
Versions: 21
Compression:
Stored size: 665 Bytes
Contents
# frozen_string_literal: true require File.dirname(__FILE__) + '/spec_helper' RSpec.describe YARD::Server::WebrickServlet do describe "#do_GET" do it "performs a GET" do resp = OpenStruct.new class << resp def []=(name, value) (self.headers ||= {})[name] = value end end server = double(:server, :[] => nil) adapter = mock_adapter adapter.router = proc { [200, {'Header' => 'foo'}, ['body']] } WebrickServlet.new(server, adapter).do_GET(mock_request('/foo'), resp) expect(resp.status).to eq 200 expect(resp.headers).to eq('Header' => 'foo') expect(resp.body).to eq 'body' end end end
Version data entries
21 entries across 20 versions & 4 rubygems