Sha256: 59cb3554c88df5e6573d95d36d0840cf061cddd9a371957bd672fa08cf54c66c

Contents?: true

Size: 713 Bytes

Versions: 8

Compression:

Stored size: 713 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 = double(:superapp)
    @app = YARD::Server::RackMiddleware.new(@superapp, :libraries => {'foo' => [LibraryVersion.new('foo', nil)]})
  end

  after(:all) { YARD::Server::Adapter.shutdown }

  it "handles requests" do
    expect(@app.call(Rack::MockRequest.env_for('/'))[0]).to eq 200
  end

  it "passes up to the next middleware on 404" do
    expect(@superapp).to receive(:call).and_return([200, {}, ['OK']])
    expect(@app.call(Rack::MockRequest.env_for('/INVALID'))).to eq [200, {}, ['OK']]
  end
end

Version data entries

8 entries across 7 versions & 2 rubygems

Version Path
abaci-0.3.0 vendor/bundle/gems/yard-0.9.2/spec/server/rack_adapter_spec.rb
abaci-0.3.0 vendor/bundle/gems/yard-0.9.1/spec/server/rack_adapter_spec.rb
yard-0.9.5 spec/server/rack_adapter_spec.rb
yard-0.9.4 spec/server/rack_adapter_spec.rb
yard-0.9.3 spec/server/rack_adapter_spec.rb
yard-0.9.2 spec/server/rack_adapter_spec.rb
yard-0.9.1 spec/server/rack_adapter_spec.rb
yard-0.9.0 spec/server/rack_adapter_spec.rb