Sha256: fd03fba8d253ffc43813a7c4d588b14a404215228e6e9ae32969bb53df3f3caa

Contents?: true

Size: 716 Bytes

Versions: 19

Compression:

Stored size: 716 Bytes

Contents

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

describe "YARD::Server::RackMiddleware" do
  before do
    begin; require 'rack'; rescue LoadError; pending "rack required for these tests" end
    @superapp = mock(:superapp)
    @app = YARD::Server::RackMiddleware.new(@superapp, :libraries => {'foo' => [LibraryVersion.new('foo', nil)]})
  end
  
  after(:all) { YARD::Server::Adapter.shutdown }
  
  it "should handle requests" do
    @app.call(Rack::MockRequest.env_for('/'))[0].should == 200
  end
  
  it "should pass up to the next middleware on 404" do
    @superapp.should_receive(:call).and_return([200, {}, ['OK']])
    @app.call(Rack::MockRequest.env_for('/INVALID')).should == [200, {}, ['OK']]
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
challah-0.6.2 vendor/bundle/gems/yard-0.7.5/spec/server/rack_adapter_spec.rb
challah-0.6.1 vendor/bundle/gems/yard-0.7.5/spec/server/rack_adapter_spec.rb
challah-0.6.0 vendor/bundle/gems/yard-0.7.5/spec/server/rack_adapter_spec.rb
challah-0.5.4 vendor/bundle/gems/yard-0.7.5/spec/server/rack_adapter_spec.rb
challah-0.5.3 vendor/bundle/gems/yard-0.7.5/spec/server/rack_adapter_spec.rb
challah-0.5.2 vendor/bundle/gems/yard-0.7.5/spec/server/rack_adapter_spec.rb
challah-0.5.1 vendor/bundle/gems/yard-0.7.5/spec/server/rack_adapter_spec.rb
challah-0.5.0 vendor/bundle/gems/yard-0.7.5/spec/server/rack_adapter_spec.rb
challah-0.4.1 vendor/bundle/gems/yard-0.7.5/spec/server/rack_adapter_spec.rb
challah-0.4.0 vendor/bundle/gems/yard-0.7.5/spec/server/rack_adapter_spec.rb
challah-0.3.5 vendor/bundle/gems/yard-0.7.5/spec/server/rack_adapter_spec.rb
challah-0.3.4 vendor/bundle/gems/yard-0.7.5/spec/server/rack_adapter_spec.rb
challah-0.3.3 vendor/bundle/gems/yard-0.7.5/spec/server/rack_adapter_spec.rb
challah-0.3.2 vendor/bundle/gems/yard-0.7.5/spec/server/rack_adapter_spec.rb
challah-0.3.1 vendor/bundle/gems/yard-0.7.5/spec/server/rack_adapter_spec.rb
challah-0.3.0 vendor/bundle/gems/yard-0.7.5/spec/server/rack_adapter_spec.rb
challah-0.2.1 vendor/bundle/gems/yard-0.7.5/spec/server/rack_adapter_spec.rb
challah-0.2.0 vendor/bundle/gems/yard-0.7.5/spec/server/rack_adapter_spec.rb
yard-0.7.5 spec/server/rack_adapter_spec.rb