Blob Blame History Raw
From 143ff04784a41582acd45bd6ba1f0589b1c8cf1e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Wed, 17 Jan 2018 17:08:22 +0100
Subject: [PATCH] Really delete the directories.

The FileUtils.rmdir deletes just empty directories and secretly fails to
do so in Ruby 2.4. Ruby 2.5 fixes the behavior [1] and FileUtiles.rmdir
fails with error such as:

~~~
Errno::ENOTEMPTY: Directory not empty @ dir_s_rmdir - /tmp/d20180114-8362-1iuw12n_other
~~~

[1] https://bugs.ruby-lang.org/issues/13889
---
 test/unit_test.rb | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/unit_test.rb b/test/unit_test.rb
index cd96c1e..d4fcde1 100644
--- a/test/unit_test.rb
+++ b/test/unit_test.rb
@@ -27,8 +27,8 @@ class ListenWatcherTest < Spring::Test::WatcherTest
       dirs = [dir, other_dir_1, other_dir_2].sort.map { |path| Pathname.new(path) }
       assert_equal dirs, watcher.base_directories.sort
     ensure
-      FileUtils.rmdir other_dir_1
-      FileUtils.rmdir other_dir_2
+      FileUtils.rm_rf other_dir_1
+      FileUtils.rm_rf other_dir_2
     end
   end
 
@@ -49,8 +49,8 @@ class ListenWatcherTest < Spring::Test::WatcherTest
       dirs = [dir, other_dir_1, other_dir_2].sort.map { |path| Pathname.new(path) }
       assert_equal dirs, watcher.base_directories.sort
     ensure
-      FileUtils.rmdir other_dir_1
-      FileUtils.rmdir other_dir_2
+      FileUtils.rm_rf other_dir_1
+      FileUtils.rm_rf other_dir_2
     end
   end
 end
-- 
2.15.1