rb: Add spec to ensure UNIXServerSocket deletes the socket when closing
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669023 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/rb/spec/unixsocket_spec.rb b/lib/rb/spec/unixsocket_spec.rb
index 777ef04..abc166a 100644
--- a/lib/rb/spec/unixsocket_spec.rb
+++ b/lib/rb/spec/unixsocket_spec.rb
@@ -50,6 +50,16 @@
UNIXServer.should_receive(:new).with(@path).and_return(handle)
@socket.listen
handle.should_receive(:close)
+ File.stub!(:delete)
+ @socket.close
+ end
+
+ it "should delete the socket when closed" do
+ handle = mock("UNIXServer", :closed? => false)
+ UNIXServer.should_receive(:new).with(@path).and_return(handle)
+ @socket.listen
+ handle.stub!(:close)
+ File.should_receive(:delete).with(@path)
@socket.close
end