summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-01-26 15:16:09 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-01-26 15:16:09 +0000
commit2a2b9a1381eb426cd789b99e1bdc75596cdb94a5 (patch)
treec2bf9e5d2df4ba92b0b4fe0c47ce573006ece3a9
parent7f8ca715f77642e47aca1163cc6c4fb3c6bd0f88 (diff)
* test/fileutils/test_fileutils.rb (setup): support BSD-style directory group inheritance. (backport from HEAD, rev 1.32)
* test/fileutils/fileasserts.rb (assert_same_entry): show entry difference. (backport from HEAD, rev 1.4) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--test/fileutils/fileasserts.rb19
-rw-r--r--test/fileutils/test_fileutils.rb11
3 files changed, 23 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 4ff8536b73..732f83b402 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Thu Jan 27 00:15:29 2005 Minero Aoki <aamine@loveruby.net>
+
+ * test/fileutils/test_fileutils.rb (setup): support BSD-style
+ directory group inheritance. (backport from HEAD, rev 1.32)
+
+ * test/fileutils/fileasserts.rb (assert_same_entry): show entry
+ difference. (backport from HEAD, rev 1.4)
+
Wed Jan 26 23:09:11 2005 Minero Aoki <aamine@loveruby.net>
* lib/net/protocol.rb (WriteAdapter#puts): should append \n, not
diff --git a/test/fileutils/fileasserts.rb b/test/fileutils/fileasserts.rb
index ea03534545..c2e9244a96 100644
--- a/test/fileutils/fileasserts.rb
+++ b/test/fileutils/fileasserts.rb
@@ -13,18 +13,13 @@ module Test
end
def assert_same_entry(from, to)
- _wrap_assertion {
- assert_block("entry #{from} != #{to}") {
- a = File.stat(from)
- b = File.stat(to)
-
- a.mode == b.mode and
- #a.atime == b.atime and
- a.mtime == b.mtime and
- a.uid == b.uid and
- a.gid == b.gid
- }
- }
+ a = File.stat(from)
+ b = File.stat(to)
+ assert_equal a.mode, b.mode, "mode #{a.mode} != #{b.mode}"
+ #assert_equal a.atime, b.atime
+ assert_equal a.mtime, b.mtime, "mtime #{a.mtime} != #{b.mtime}"
+ assert_equal a.uid, b.uid, "uid #{a.uid} != #{b.uid}"
+ assert_equal a.gid, b.gid, "gid #{a.gid} != #{b.gid}"
end
def assert_file_exist(path)
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb
index 8e64b55030..597e3a4e58 100644
--- a/test/fileutils/test_fileutils.rb
+++ b/test/fileutils/test_fileutils.rb
@@ -76,13 +76,18 @@ class TestFileUtils
end
end
+ def mymkdir(path)
+ Dir.mkdir path
+ File.chown nil, Process.gid, path if have_file_perm?
+ end
+
def setup
@prevdir = Dir.pwd
tmproot = TMPROOT
- Dir.mkdir tmproot unless File.directory?(tmproot)
+ mymkdir tmproot unless File.directory?(tmproot)
Dir.chdir tmproot
- my_rm_rf 'data'; Dir.mkdir 'data'
- my_rm_rf 'tmp'; Dir.mkdir 'tmp'
+ my_rm_rf 'data'; mymkdir 'data'
+ my_rm_rf 'tmp'; mymkdir 'tmp'
prepare_data_file
prepare_time_data
end