OSDN Git Service

1abcdb6983cda11a98eb3a9561ddf07dcffc15a1
[redminele/redminele.git] / ruby / lib / ruby / gems / 1.8 / gems / thin-1.2.11-x86-mswin32 / spec / backends / unix_server_spec.rb
1 require File.dirname(__FILE__) + '/../spec_helper'
2
3 describe Backends::UnixServer do
4   before do
5     @backend = Backends::UnixServer.new('/tmp/thin-test.sock')
6   end
7   
8   it "should connect" do
9     EventMachine.run do
10       @backend.connect
11       EventMachine.stop
12     end
13   end
14   
15   it "should disconnect" do
16     EventMachine.run do
17       @backend.connect
18       @backend.disconnect
19       EventMachine.stop
20     end
21   end
22   
23   it "should remove socket file on close" do
24     @backend.close
25     File.exist?('/tmp/thin-test.sock').should be_false
26   end
27 end
28
29 describe UnixConnection do
30   before do
31     @connection = UnixConnection.new(nil)
32   end
33   
34   it "should return 127.0.0.1 as remote_address" do
35     @connection.remote_address.should == '127.0.0.1'
36   end
37 end