diff options
| author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-27 00:44:50 +0000 |
|---|---|---|
| committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-27 00:44:50 +0000 |
| commit | a1234f6a3dccebce7a119f22c880097ef1349b03 (patch) | |
| tree | 31801a3ee62a6dd124a321930c47d6f6aa5ccf58 /test/fileutils/test_nowrite.rb | |
| parent | 5f4b705f43b69348ba842bc04b018c9c16fe58e6 (diff) | |
| download | ruby-a1234f6a3dccebce7a119f22c880097ef1349b03.tar.gz ruby-a1234f6a3dccebce7a119f22c880097ef1349b03.tar.xz ruby-a1234f6a3dccebce7a119f22c880097ef1349b03.zip | |
* test/fileutils/test_fileutils.rb: clear all errors on Windows.
* test/fileutils/test_nowrite.rb: ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/fileutils/test_nowrite.rb')
| -rw-r--r-- | test/fileutils/test_nowrite.rb | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/test/fileutils/test_nowrite.rb b/test/fileutils/test_nowrite.rb index dc9408f3c..d475c3ab0 100644 --- a/test/fileutils/test_nowrite.rb +++ b/test/fileutils/test_nowrite.rb @@ -1,5 +1,5 @@ # -# +# test/fileutils/test_nowrite.rb # $:.unshift File.dirname(__FILE__) @@ -13,18 +13,27 @@ class TestNoWrite < Test::Unit::TestCase include FileUtils::NoWrite + def my_rm_rf( path ) + if File.exist?('/bin/rm') + system "/bin/rm -rf #{path}" + else + FileUtils.rm_rf path + end + end + SRC = 'data/src' COPY = 'data/copy' def setup - system 'rm -rf data; mkdir data' - system 'rm -rf tmp; mkdir tmp' - File.open( SRC, 'w' ) {|f| f.puts 'dummy' } - File.open( COPY, 'w' ) {|f| f.puts 'dummy' } + my_rm_rf 'date'; Dir.mkdir 'data' + my_rm_rf 'tmp'; Dir.mkdir 'tmp' + File.open(SRC, 'w') {|f| f.puts 'dummy' } + File.open(COPY, 'w') {|f| f.puts 'dummy' } end def teardown - system 'rm -rf data tmp' + my_rm_rf 'data' + my_rm_rf 'tmp' end def test_cp |
