Sha256: e3b59ce4838c9c8faaac492e1230a706029203417e3ade1ab24ecade21af0786

Contents?: true

Size: 884 Bytes

Versions: 9

Compression:

Stored size: 884 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_an_instance_of(Hash)
  end

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

describe "transparent middleware", :shared => true do
  it "delegates request handling to wrapped Rack application" do
    @result.last.to_s.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

9 entries across 6 versions & 1 rubygems

Version Path
merb-core-1.1.3 spec10/public/rack/shared_example_groups.rb
merb-core-1.1.2 spec10/public/rack/shared_example_groups.rb
merb-core-1.1.1 spec10/public/rack/shared_example_groups.rb
merb-core-1.1.0 spec10/public/rack/shared_example_groups.rb
merb-core-1.1.0 spec/public/rack/shared_example_groups.rb
merb-core-1.1.0.rc1 spec/public/rack/shared_example_groups.rb
merb-core-1.1.0.rc1 spec10/public/rack/shared_example_groups.rb
merb-core-1.1.0.pre spec10/public/rack/shared_example_groups.rb
merb-core-1.1.0.pre spec/public/rack/shared_example_groups.rb