Sha256: 9c40fa0047d92c55be2b969e818651a80f96b6ea0955d4c7ddfde62724867368

Contents?: true

Size: 1.16 KB

Versions: 42

Compression:

Stored size: 1.16 KB

Contents

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

describe Request, 'persistent' do
  before do
    @request = Request.new
  end
  
  it "should not assume that a persistent connection is maintained for HTTP version 1.0" do
    @request.env['HTTP_VERSION'] = 'HTTP/1.0'
    @request.should_not be_persistent
  end

  it "should assume that a persistent connection is maintained for HTTP version 1.0 when specified" do
    @request.env['HTTP_VERSION'] = 'HTTP/1.0'
    @request.env['HTTP_CONNECTION'] = 'Keep-Alive'
    @request.should be_persistent
  end
  
  it "should maintain a persistent connection for HTTP/1.1 client" do
    @request.env['HTTP_VERSION'] = 'HTTP/1.1'
    @request.env['HTTP_CONNECTION'] = 'Keep-Alive'
    @request.should be_persistent
  end

  it "should maintain a persistent connection for HTTP/1.1 client by default" do
    @request.env['HTTP_VERSION'] = 'HTTP/1.1'
    @request.should be_persistent
  end

  it "should not maintain a persistent connection for HTTP/1.1 client when Connection header include close" do
    @request.env['HTTP_VERSION'] = 'HTTP/1.1'
    @request.env['HTTP_CONNECTION'] = 'close'
    @request.should_not be_persistent
  end
end

Version data entries

42 entries across 42 versions & 6 rubygems

Version Path
grockit-thin-0.8.2 spec/request/persistent_spec.rb
macournoyer-thin-1.0.1 spec/request/persistent_spec.rb
macournoyer-thin-1.1.0 spec/request/persistent_spec.rb
michaelyta-thin-1.2.2 spec/request/persistent_spec.rb
thin-1.2.11 spec/request/persistent_spec.rb
thin-1.2.11-x86-mswin32 spec/request/persistent_spec.rb
thin-1.2.11-x86-mingw32 spec/request/persistent_spec.rb
thin-1.2.10 spec/request/persistent_spec.rb
thin-1.2.10-x86-mswin32 spec/request/persistent_spec.rb
thin-1.2.10-x86-mingw32 spec/request/persistent_spec.rb
thin-1.2.9 spec/request/persistent_spec.rb
thin-1.2.9-x86-mswin32 spec/request/persistent_spec.rb
thin-1.2.9-x86-mingw32 spec/request/persistent_spec.rb
thin-1.2.8 spec/request/persistent_spec.rb
thin-1.2.8-x86-mswin32 spec/request/persistent_spec.rb
thin-1.2.8-x86-mingw32 spec/request/persistent_spec.rb
steamcannon-thin-1.2.8 spec/request/persistent_spec.rb
thin-1.2.7 spec/request/persistent_spec.rb
thin-1.2.7-x86-mswin32 spec/request/persistent_spec.rb
thin-1.2.7-x86-mingw32 spec/request/persistent_spec.rb