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