File: unix_socket_spec.rb

package info (click to toggle)
thin 1.2.4-1.1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,252 kB
  • ctags: 531
  • sloc: ruby: 4,529; ansic: 725; sh: 21; makefile: 16
file content (26 lines) | stat: -rw-r--r-- 607 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
require File.dirname(__FILE__) + '/../spec_helper'

describe Server, "on UNIX domain socket" do
  before do
    start_server('/tmp/thin_test.sock') do |env|
      [200, { 'Content-Type' => 'text/html' }, [env.inspect]]
    end
  end
  
  it "should accept GET request" do
    get("/?this").should include('this')
  end
  
  it "should retreive remote address" do    
    get('/').should include('"REMOTE_ADDR"=>"127.0.0.1"')
  end
  
  it "should remove socket file after server stops" do
    @server.stop!
    File.exist?('/tmp/thin_test.sock').should be_false
  end
  
  after do
    stop_server
  end
end