summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-12 12:29:32 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-12 12:29:32 +0000
commit2ec793ab270ab1edeab503355eb627144cc05b70 (patch)
tree2d203b6feef0661735680902fad9d585b33e72b1 /test
parentf6d77bf56082a9d0b21301384daf8ce9cbfccd4c (diff)
* lib/net/ftp.rb (FACT_PARSERS): support system dependent facts
UNIX.mode, UNIX.owner, UNIX.group, UNIX.ctime, and UNIX.atime. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/net/ftp/test_ftp.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/net/ftp/test_ftp.rb b/test/net/ftp/test_ftp.rb
index d347a30a1e..711bbab6f7 100644
--- a/test/net/ftp/test_ftp.rb
+++ b/test/net/ftp/test_ftp.rb
@@ -1125,7 +1125,7 @@ EOF
sock.print("220 (test_ftp).\r\n")
commands.push(sock.gets)
sock.print("250- Listing foo\r\n")
- sock.print(" Type=file;Unique=FC00U1E554A;Size=1234567;Modify=20131220035929;Perm=r; /foo\r\n")
+ sock.print(" Type=file;Unique=FC00U1E554A;Size=1234567;Modify=20131220035929;Perm=r;Unix.mode=0644;Unix.owner=122;Unix.group=0;Unix.ctime=20131220120140;Unix.atime=20131220131139; /foo\r\n")
sock.print("250 End\r\n")
commands.push(sock.gets)
sock.print("250 Malformed response\r\n")
@@ -1148,6 +1148,9 @@ EOF
assert_equal("FC00U1E554A", entry.facts["unique"])
assert_equal(1234567, entry.facts["size"])
assert_equal("r", entry.facts["perm"])
+ assert_equal(0644, entry.facts["unix.mode"])
+ assert_equal(122, entry.facts["unix.owner"])
+ assert_equal(0, entry.facts["unix.group"])
modify = entry.facts["modify"]
assert_equal(2013, modify.year)
assert_equal(12, modify.month)
@@ -1156,6 +1159,14 @@ EOF
assert_equal(59, modify.min)
assert_equal(29, modify.sec)
assert_equal(true, modify.utc?)
+ ctime = entry.facts["unix.ctime"]
+ assert_equal(12, ctime.hour)
+ assert_equal(1, ctime.min)
+ assert_equal(40, ctime.sec)
+ atime = entry.facts["unix.atime"]
+ assert_equal(13, atime.hour)
+ assert_equal(11, atime.min)
+ assert_equal(39, atime.sec)
assert_match("MLST foo\r\n", commands.shift)
assert_raise(Net::FTPProtoError) do
ftp.mlst("foo")