git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669023
13f79535-47bb-0310-9956-
ffa450edef68
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