diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-21 10:38:31 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-21 10:38:31 +0000 |
commit | 30cc5ce4bdd3fce63b49e41fd4dfd7a391d52407 (patch) | |
tree | 64a3af85340273d7cd3dcff296699900b9818f49 /test/net | |
parent | 4c839a2cece0a7937b64646fabbe4fe4c19f33c3 (diff) | |
download | ruby-30cc5ce4bdd3fce63b49e41fd4dfd7a391d52407.tar.gz |
Add new options open_timeout and read_timeout to Net::FTP.new.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net')
-rw-r--r-- | test/net/ftp/test_ftp.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/net/ftp/test_ftp.rb b/test/net/ftp/test_ftp.rb index 708def13bb..4e43cda24a 100644 --- a/test/net/ftp/test_ftp.rb +++ b/test/net/ftp/test_ftp.rb @@ -278,6 +278,16 @@ class FTPTest < Test::Unit::TestCase end end + def test_s_new_timeout_options + ftp = Net::FTP.new + assert_equal(nil, ftp.open_timeout) + assert_equal(60, ftp.read_timeout) + + ftp = Net::FTP.new(nil, open_timeout: 123, read_timeout: 234) + assert_equal(123, ftp.open_timeout) + assert_equal(234, ftp.read_timeout) + end + # TODO: How can we test open_timeout? sleep before accept cannot delay # connections. def _test_open_timeout_exceeded |