You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by kc...@apache.org on 2008/06/18 03:18:57 UTC
svn commit: r669023 - /incubator/thrift/trunk/lib/rb/spec/unixsocket_spec.rb
Author: kclark
Date: Tue Jun 17 18:18:57 2008
New Revision: 669023
URL: http://svn.apache.org/viewvc?rev=669023&view=rev
Log:
rb: Add spec to ensure UNIXServerSocket deletes the socket when closing
Modified:
incubator/thrift/trunk/lib/rb/spec/unixsocket_spec.rb
Modified: incubator/thrift/trunk/lib/rb/spec/unixsocket_spec.rb
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/spec/unixsocket_spec.rb?rev=669023&r1=669022&r2=669023&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/spec/unixsocket_spec.rb (original)
+++ incubator/thrift/trunk/lib/rb/spec/unixsocket_spec.rb Tue Jun 17 18:18:57 2008
@@ -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