From 2ec793ab270ab1edeab503355eb627144cc05b70 Mon Sep 17 00:00:00 2001 From: shugo Date: Sat, 12 Sep 2015 12:29:32 +0000 Subject: * 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 --- test/net/ftp/test_ftp.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'test') 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") -- cgit v1.2.3