summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/net/ftp/test_ftp.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/net/ftp/test_ftp.rb b/test/net/ftp/test_ftp.rb
index 423cfe8e9e..3ccbb6222b 100644
--- a/test/net/ftp/test_ftp.rb
+++ b/test/net/ftp/test_ftp.rb
@@ -23,6 +23,14 @@ class FTPTest < Test::Unit::TestCase
end
end
+ def test_closed_when_not_connected
+ ftp = Net::FTP.new
+ assert_equal(true, ftp.closed?)
+ assert_nothing_raised(Net::FTPConnectionError) do
+ ftp.close
+ end
+ end
+
def test_connect_fail
server = create_ftp_server { |sock|
sock.print("421 Service not available, closing control connection.\r\n")