From: Kevin Clark Date: Wed, 18 Jun 2008 01:18:57 +0000 (+0000) Subject: rb: Add spec to ensure UNIXServerSocket deletes the socket when closing X-Git-Tag: 0.2.0~528 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=1aca9c4097a88eac003f1eee781f301d649f6be8;p=common%2Fthrift.git 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 777ef042..abc166a6 100644 --- a/lib/rb/spec/unixsocket_spec.rb +++ b/lib/rb/spec/unixsocket_spec.rb @@ -50,6 +50,16 @@ class ThriftUNIXSocketSpec < Spec::ExampleGroup 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