Extend #ds_file? in Pathname
This commit is contained in:
parent
d4df9d44e0
commit
56a0afe579
@ -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 {
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user