Sha256: de2d923f51db6577ae9d3ccd0a0f5fc0eb2a80956a7e7f92c8df7c8559a39d9c

Contents?: true

Size: 631 Bytes

Versions: 35

Compression:

Stored size: 631 Bytes

Contents

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

describe Server, 'with threads' do
  before do
    @requests = 0
    start_server DEFAULT_TEST_ADDRESS, DEFAULT_TEST_PORT, :threaded => true do |env|
      sleep env['PATH_INFO'].delete('/').to_i
      @requests += 1
      [200, { 'Content-Type' => 'text/html' }, 'hi']
    end
  end
  
  it "should process request" do
    get('/').should_not be_empty
  end
  
  it "should process requests when blocked" do
    slow_request = Thread.new { get('/3') }
    get('/').should_not be_empty
    @requests.should == 1
    slow_request.kill
  end
  
  after do
    stop_server
  end
end

Version data entries

35 entries across 35 versions & 6 rubygems

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