diff options
| author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-17 09:52:50 +0000 |
|---|---|---|
| committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-17 09:52:50 +0000 |
| commit | 3aeda105c9c01baf2c3e05e1c3b95f07d9e6ce2a (patch) | |
| tree | 71ff8da94dfca056752a35cf4350cfdcac22d4c3 /test/fileutils/fileasserts.rb | |
| parent | 9cc3419ed2b5b9a5f4887c0128ea0909bc1bbb38 (diff) | |
| download | ruby-3aeda105c9c01baf2c3e05e1c3b95f07d9e6ce2a.tar.gz ruby-3aeda105c9c01baf2c3e05e1c3b95f07d9e6ce2a.tar.xz ruby-3aeda105c9c01baf2c3e05e1c3b95f07d9e6ce2a.zip | |
* test/fileutils/fileassertions.rb: new file.
* test/fileutils/test_fileutils.rb: new file.
* test/fileutils/test_nowrite.rb: new file.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/fileutils/fileasserts.rb')
| -rw-r--r-- | test/fileutils/fileasserts.rb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/fileutils/fileasserts.rb b/test/fileutils/fileasserts.rb new file mode 100644 index 000000000..0b3d67bd3 --- /dev/null +++ b/test/fileutils/fileasserts.rb @@ -0,0 +1,43 @@ +# +# test/fileutils/fileasserts.rb +# + +module Test + module Unit + module Assertions # redefine + + def assert_same_file( from, to ) + _wrap_assertion { + assert_block("file #{from} != #{to}") { + File.read(from) == File.read(to) + } + } + end + + def assert_file_exist( file ) + _wrap_assertion { + assert_block("file not exist: #{file}") { + File.exist?(file) + } + } + end + + def assert_file_not_exist( file ) + _wrap_assertion { + assert_block("file not exist: #{file}") { + not File.exist?(file) + } + } + end + + def assert_is_directory( file ) + _wrap_assertion { + assert_block("is not directory: #{file}") { + File.directory?(file) + } + } + end + + end + end +end |
