summaryrefslogtreecommitdiff
path: root/test/rake/test_rake_clean.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rake/test_rake_clean.rb')
-rw-r--r--test/rake/test_rake_clean.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/rake/test_rake_clean.rb b/test/rake/test_rake_clean.rb
index 5e38950d38..0bce7bc0b1 100644
--- a/test/rake/test_rake_clean.rb
+++ b/test/rake/test_rake_clean.rb
@@ -15,7 +15,7 @@ class TestRakeClean < Rake::TestCase
file_name = create_undeletable_file
out, _ = capture_io do
- Rake::Cleaner.cleanup(file_name, verbose: false)
+ Rake::Cleaner.cleanup(file_name, :verbose => false)
end
assert_match(/failed to remove/i, out)
@@ -23,6 +23,15 @@ class TestRakeClean < Rake::TestCase
remove_undeletable_file
end
+ def test_cleanup_ignores_missing_files
+ file_name = File.join(@tempdir, "missing_directory", "no_such_file")
+
+ out, _ = capture_io do
+ Rake::Cleaner.cleanup(file_name, :verbose => false)
+ end
+ refute_match(/failed to remove/i, out)
+ end
+
private
def create_undeletable_file
@@ -46,7 +55,7 @@ class TestRakeClean < Rake::TestCase
file_name = File.join(dir_name, "deleteme")
FileUtils.chmod(0777, dir_name)
FileUtils.chmod(0777, file_name)
- Rake::Cleaner.cleanup(file_name, verbose: false)
- Rake::Cleaner.cleanup(dir_name, verbose: false)
+ Rake::Cleaner.cleanup(file_name, :verbose => false)
+ Rake::Cleaner.cleanup(dir_name, :verbose => false)
end
end