diff options
| author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-11-18 05:09:20 +0000 |
|---|---|---|
| committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-11-18 05:09:20 +0000 |
| commit | 74a0df5659a7ec3c3a9874a2f774fd9cb4f8e617 (patch) | |
| tree | 7a5feb25ec3bed8848b838c4ab0859878c3ff7c9 /test/fileutils/fileasserts.rb | |
| parent | c4c4e01550d7d280221b2df0ec3d1a8ecb60f3cd (diff) | |
| download | ruby-74a0df5659a7ec3c3a9874a2f774fd9cb4f8e617.tar.gz ruby-74a0df5659a7ec3c3a9874a2f774fd9cb4f8e617.tar.xz ruby-74a0df5659a7ec3c3a9874a2f774fd9cb4f8e617.zip | |
* lib/fileutils.rb (fu_each_src_dest): raise if src==dest. [ruby-talk:85344] [ruby-core:01699]
* lib/fileutils.rb: use Object#is_a? instead of Class#=== to allow e.g. remote objects for receivers.
* lib/fileutils.rb: FileTest -> File.
* lib/fileutils.rb: put parentheses for arguments of File.xxxx?
* test/fileutils/test_fileutils.rb (test_cp): test "cp a a".
* test/fileutils/test_fileutils.rb (test_mv): test "mv a a".
* test/fileutils/test_fileutils.rb (test_ln): test "ln a a".
* test/fileutils/test_fileutils.rb (test_ln_s): test "ln_s a a".
* test/fileutils/test_fileutils.rb (test_install): test "install a a".
* test/fileutils/fileasserts.rb: new method assert_symlink.
* test/fileutils/fileasserts.rb: assert_is_directory -> assert_directory.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/fileutils/fileasserts.rb')
| -rw-r--r-- | test/fileutils/fileasserts.rb | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/test/fileutils/fileasserts.rb b/test/fileutils/fileasserts.rb index 0b3d67bd3..2a96351bc 100644 --- a/test/fileutils/fileasserts.rb +++ b/test/fileutils/fileasserts.rb @@ -14,26 +14,34 @@ module Test } end - def assert_file_exist( file ) + def assert_file_exist( path ) _wrap_assertion { - assert_block("file not exist: #{file}") { - File.exist?(file) + assert_block("file not exist: #{path}") { + File.exist?(path) } } end - def assert_file_not_exist( file ) + def assert_file_not_exist( path ) _wrap_assertion { - assert_block("file not exist: #{file}") { - not File.exist?(file) + assert_block("file not exist: #{path}") { + not File.exist?(path) } } end - def assert_is_directory( file ) + def assert_directory( path ) _wrap_assertion { - assert_block("is not directory: #{file}") { - File.directory?(file) + assert_block("is not directory: #{path}") { + File.directory?(path) + } + } + end + + def assert_symlink( path ) + _wrap_assertion { + assert_block("is no symlink: #{path}") { + File.symlink?(path) } } end |
