Sha256: 28fc03d55336394a16df37ae744ae851dfc53d814c87e8b76bc7cde98b8297e8

Contents?: true

Size: 632 Bytes

Versions: 107

Compression:

Stored size: 632 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe YARD::Server::WebrickServlet do
  describe '#do_GET' do
    it "should perform a GET" do
      resp = OpenStruct.new
      class << resp
        def []=(name, value) (self.headers ||= {})[name] = value end
      end
      server = mock(:server)
      server.stub!(:[])
      adapter = mock_adapter
      adapter.router = proc { [200, {'Header' => 'foo'}, ['body']]}
      WebrickServlet.new(server, adapter).do_GET(mock_request('/foo'), resp)
      resp.status.should == 200
      resp.headers.should == {'Header' => 'foo'}
      resp.body.should == 'body'
    end
  end
end

Version data entries

107 entries across 88 versions & 9 rubygems

Version Path
yard-0.8.7.6 spec/server/webrick_servlet_spec.rb
yard-0.8.7.5 spec/server/webrick_servlet_spec.rb
climine-0.0.7 vendor/bundle/ruby/2.1.0/gems/yard-0.8.7.3/spec/server/webrick_servlet_spec.rb
climine-0.0.7 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/server/webrick_servlet_spec.rb
climine-0.0.6 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/server/webrick_servlet_spec.rb
climine-0.0.5 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/server/webrick_servlet_spec.rb
yard-0.8.7.4 spec/server/webrick_servlet_spec.rb
climine-0.0.4 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/server/webrick_servlet_spec.rb
climine-0.0.3 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/server/webrick_servlet_spec.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/yard-0.8.7.3/spec/server/webrick_servlet_spec.rb
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/yard-0.8.7.3/spec/server/webrick_servlet_spec.rb
mango-0.7.0 vendor/bundler/ruby/2.0.0/gems/yard-0.8.7.3/spec/server/webrick_servlet_spec.rb
climine-0.0.2 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/server/webrick_servlet_spec.rb
climine-0.0.1 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/spec/server/webrick_servlet_spec.rb
yard-0.8.7.3 spec/server/webrick_servlet_spec.rb
yard-0.8.7.2 spec/server/webrick_servlet_spec.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/yard-0.8.7/spec/server/webrick_servlet_spec.rb
candlepin-api-0.4.0 bundle/ruby/gems/yard-0.8.7/spec/server/webrick_servlet_spec.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/yard-0.8.7/spec/server/webrick_servlet_spec.rb
yard-0.8.7.1 spec/server/webrick_servlet_spec.rb