diff options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/extend/pathname.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/pathname_test.rb | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index cfb028704..12dca4320 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -457,6 +457,10 @@ class Pathname end end + def ds_store? + basename.to_s == ".DS_Store" + end + # https://bugs.ruby-lang.org/issues/9915 if RUBY_VERSION == "2.0.0" prepend Module.new { diff --git a/Library/Homebrew/test/pathname_test.rb b/Library/Homebrew/test/pathname_test.rb index b48a26fbd..0107c8675 100644 --- a/Library/Homebrew/test/pathname_test.rb +++ b/Library/Homebrew/test/pathname_test.rb @@ -166,6 +166,11 @@ class PathnameTests < Homebrew::TestCase @dir.cp_path_sub @src, @dst assert_predicate @dst/@dir.basename, :directory? end + + def test_ds_store + refute_predicate @file, :ds_store? + assert_predicate @src/".DS_Store", :ds_store? + end end class PathnameInstallTests < Homebrew::TestCase |
