Sha256: 22b842074b072288f299b4c3b1ab428ba6f0c66353ec4857b545b19f93229176
Contents?: true
Size: 724 Bytes
Versions: 49
Compression:
Stored size: 724 Bytes
Contents
require File.expand_path('../../../../spec_helper', __FILE__) require 'net/ftp' describe "Net::FTP#close" do before(:each) do @socket = mock("Socket") @socket.stub!(:closed?).and_return(false) @ftp = Net::FTP.new @ftp.instance_variable_set(:@sock, @socket) end it "closes the socket" do @socket.should_receive(:close) @ftp.close.should be_nil end it "does not try to close the socket if it has already been closed" do @socket.should_receive(:closed?).and_return(true) @socket.should_not_receive(:close) @ftp.close.should be_nil end it "does not try to close the socket if it is nil" do @ftp.instance_variable_set(:@sock, nil) @ftp.close.should be_nil end end
Version data entries
49 entries across 49 versions & 2 rubygems