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

Version Path
yard-0.9.24 spec/server/webrick_servlet_spec.rb
yard-0.9.23 spec/server/webrick_servlet_spec.rb
yard-0.9.22 spec/server/webrick_servlet_spec.rb
yard-0.9.21 spec/server/webrick_servlet_spec.rb
yard-0.9.20 spec/server/webrick_servlet_spec.rb
yard-0.9.19 spec/server/webrick_servlet_spec.rb
yard-0.9.16 spec/server/webrick_servlet_spec.rb
yard-0.9.15 spec/server/webrick_servlet_spec.rb
yard-0.9.14 spec/server/webrick_servlet_spec.rb
yard-0.9.13 spec/server/webrick_servlet_spec.rb
yard-0.9.12 spec/server/webrick_servlet_spec.rb
yard-0.9.11 spec/server/webrick_servlet_spec.rb
yard-0.9.10 spec/server/webrick_servlet_spec.rb
yard-0.9.9 spec/server/webrick_servlet_spec.rb
etude_for_ruby-0.1.4 vendor/bundle/ruby/2.4.0/gems/yard-0.9.8/spec/server/webrick_servlet_spec.rb
etude_for_ruby-0.1.4 vendor/bundle/ruby/2.2.0/gems/yard-0.9.8/spec/server/webrick_servlet_spec.rb
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/yard-0.9.8/spec/server/webrick_servlet_spec.rb
yard-0.9.8 spec/server/webrick_servlet_spec.rb
abaci-0.3.0 vendor/bundle/gems/yard-0.9.7/spec/server/webrick_servlet_spec.rb
yard-0.9.7 spec/server/webrick_servlet_spec.rb