From 19b9567c8421eee4755701763ef00f4c9f7ffe41 Mon Sep 17 00:00:00 2001 From: aamine Date: Wed, 26 Jan 2005 15:03:37 +0000 Subject: * test/fileutils/test_fileutils.rb (setup): support BSD style directory group inheritance. [ruby-dev:25440] * test/fileutils/fileasserts.rb (assert_same_entry): show entry difference. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ test/fileutils/fileasserts.rb | 19 +++++++------------ test/fileutils/test_fileutils.rb | 8 +++++++- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index fad21b847f..d633ee765e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Thu Jan 27 00:02:40 2005 Minero Aoki + + * test/fileutils/test_fileutils.rb (setup): support BSD style + directory group inheritance. [ruby-dev:25440] + + * test/fileutils/fileasserts.rb (assert_same_entry): show entry + difference. + Wed Jan 26 14:12:58 2005 NAKAMURA Usaku * ext/Setup*: remove tcltklib. 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 480ef548ce..1c50c10b2d 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -14,6 +14,7 @@ prevdir = Dir.pwd tmproot = TestFileUtils::TMPROOT Dir.mkdir tmproot unless File.directory?(tmproot) Dir.chdir tmproot +p tmproot def have_drive_letter? /djgpp|mswin(?!ce)|mingw|bcc|emx/ =~ RUBY_PLATFORM @@ -76,10 +77,15 @@ 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' -- cgit v1.2.3