OSDN Git Service

Replaced mongrel with thin
[redminele/redminele.git] / ruby / lib / ruby / gems / 1.8 / gems / thin-1.2.11-x86-mswin32 / spec / backends / unix_server_spec.rb
diff --git a/ruby/lib/ruby/gems/1.8/gems/thin-1.2.11-x86-mswin32/spec/backends/unix_server_spec.rb b/ruby/lib/ruby/gems/1.8/gems/thin-1.2.11-x86-mswin32/spec/backends/unix_server_spec.rb
new file mode 100644 (file)
index 0000000..1abcdb6
--- /dev/null
@@ -0,0 +1,37 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe Backends::UnixServer do
+  before do
+    @backend = Backends::UnixServer.new('/tmp/thin-test.sock')
+  end
+  
+  it "should connect" do
+    EventMachine.run do
+      @backend.connect
+      EventMachine.stop
+    end
+  end
+  
+  it "should disconnect" do
+    EventMachine.run do
+      @backend.connect
+      @backend.disconnect
+      EventMachine.stop
+    end
+  end
+  
+  it "should remove socket file on close" do
+    @backend.close
+    File.exist?('/tmp/thin-test.sock').should be_false
+  end
+end
+
+describe UnixConnection do
+  before do
+    @connection = UnixConnection.new(nil)
+  end
+  
+  it "should return 127.0.0.1 as remote_address" do
+    @connection.remote_address.should == '127.0.0.1'
+  end
+end
\ No newline at end of file