Sha256: e0415b3786ea842233ced96d6d9bd8173d3ea9b9c526f990edb497914ed7d434

Contents?: true

Size: 750 Bytes

Versions: 21

Compression:

Stored size: 750 Bytes

Contents

# frozen_string_literal: true
require File.dirname(__FILE__) + "/spec_helper"

RSpec.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

21 entries across 20 versions & 4 rubygems

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