aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/test/test_cleaner.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_cleaner.rb b/Library/Homebrew/test/test_cleaner.rb
index 42eb66403..c3def7cd7 100644
--- a/Library/Homebrew/test/test_cleaner.rb
+++ b/Library/Homebrew/test/test_cleaner.rb
@@ -28,6 +28,36 @@ class CleanerTests < Test::Unit::TestCase
assert_equal 0100444, (@f.lib/'i386.dylib').stat.mode
end
+ def test_prunes_empty_directories
+ subdir = @f.bin/'subdir'
+ subdir.mkpath
+
+ Cleaner.new @f
+
+ assert !@f.bin.directory?
+ assert !subdir.directory?
+ end
+
+ def test_skip_clean_empty_directory
+ @f.class.skip_clean 'bin'
+ @f.bin.mkpath
+
+ Cleaner.new @f
+
+ assert @f.bin.directory?
+ end
+
+ def test_skip_clean_directory_with_empty_subdir
+ @f.class.skip_clean 'bin'
+ subdir = @f.bin/'subdir'
+ subdir.mkpath
+
+ Cleaner.new @f
+
+ assert @f.bin.directory?
+ assert subdir.directory?
+ end
+
def test_fails_to_remove_symlink_when_target_was_pruned_first
mkpath @f.prefix/'b'
ln_s 'b', @f.prefix/'a'