From 422c8baeb9639cc51a9f7d458c521f9bd4d98969 Mon Sep 17 00:00:00 2001 From: shugo Date: Mon, 26 Mar 2012 14:39:16 +0000 Subject: * lib/net/ftp.rb (parse_pasv_port): refactored. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/net/ftp/test_ftp.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/net/ftp') diff --git a/test/net/ftp/test_ftp.rb b/test/net/ftp/test_ftp.rb index 242394063c..209250d675 100644 --- a/test/net/ftp/test_ftp.rb +++ b/test/net/ftp/test_ftp.rb @@ -99,4 +99,12 @@ class FTPTest < Test::Unit::TestCase ftp.send(:parse229, "229 ) foo bar (") end end + + def test_parse_pasv_port + ftp = Net::FTP.new + assert_equal(12, ftp.send(:parse_pasv_port, "12")) + assert_equal(3106, ftp.send(:parse_pasv_port, "12,34")) + assert_equal(795192, ftp.send(:parse_pasv_port, "12,34,56")) + assert_equal(203569230, ftp.send(:parse_pasv_port, "12,34,56,78")) + end end -- cgit v1.2.3