Sha256: 43e6052e214afa116207473130198a28e9f75f035a9354bc76642b40c220d865

Contents?: true

Size: 867 Bytes

Versions: 3

Compression:

Stored size: 867 Bytes

Contents

describe "rack application", :shared => true do
  it 'is callable' do
    @app.should respond_to(:call)
  end

  it 'returns a 3-tuple' do
    @result.size.should == 3
  end

  it 'returns status as first tuple element' do
    @result.first.should == 200
  end

  it 'returns hash of headers as the second tuple element' do
    @result[1].should be_kind_of(Hash)
  end

  it 'returns response body as third tuple element' do
    @result.last.should == @body
  end
end

describe "transparent middleware", :shared => true do
  it "delegates request handling to wrapped Rack application" do
    @result.last.should == @body
  end

  describe "#deferred?" do
    it "is delegated to wrapped Rack application" do
      @middleware.deferred?(@env).should be(true)
      @middleware.deferred?(Rack::MockRequest.env_for('/not-deferred/')).should be(false)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
merb-core-1.1.3 spec/public/rack/shared_example_groups.rb
merb-core-1.1.2 spec/public/rack/shared_example_groups.rb
merb-core-1.1.1 spec/public/rack/shared_example_groups.rb