@@ -352,6 +352,32 @@ Just delegates OPERATION and ARGS for all operations except for`shell-command`'.
352352 (expect (projectile-ignored-file-p " /path/to/project/TAGS" ) :to-be-truthy )
353353 (expect (projectile-ignored-file-p " /path/to/project/foo.el" ) :not :to-be-truthy )))
354354
355+ (describe " projectile-globally-ignored-files"
356+ (it " includes TAGS file by default"
357+ (expect (member projectile-tags-file-name projectile-globally-ignored-files) :to-be-truthy ))
358+ (it " includes cache file by default"
359+ (expect (member projectile-cache-file projectile-globally-ignored-files) :to-be-truthy ))
360+ (it " causes cache file to be ignored via projectile-ignored-file-p"
361+ (spy-on 'projectile-ignored-files :and-return-value
362+ (list (concat " /path/to/project/" projectile-cache-file)
363+ (concat " /path/to/project/" projectile-tags-file-name)))
364+ (expect (projectile-ignored-file-p (concat " /path/to/project/" projectile-cache-file)) :to-be-truthy )
365+ (expect (projectile-ignored-file-p " /path/to/project/source.el" ) :not :to-be-truthy )))
366+
367+ (describe " projectile-globally-ignored-files :safe predicate"
368+ (it " accepts list of strings as safe"
369+ (let ((pred (get 'projectile-globally-ignored-files 'safe-local-variable )))
370+ (expect (funcall pred '(" file1" " file2" )) :to-be-truthy )))
371+ (it " rejects list containing non-strings as unsafe"
372+ (let ((pred (get 'projectile-globally-ignored-files 'safe-local-variable )))
373+ (expect (funcall pred '(" file1" 123 )) :not :to-be-truthy )))
374+ (it " accepts empty list as safe"
375+ (let ((pred (get 'projectile-globally-ignored-files 'safe-local-variable )))
376+ (expect (funcall pred '()) :to-be-truthy )))
377+ (it " rejects non-list as unsafe"
378+ (let ((pred (get 'projectile-globally-ignored-files 'safe-local-variable )))
379+ (expect (funcall pred " not-a-list" ) :not :to-be-truthy ))))
380+
355381(describe " projectile-ignored-files"
356382 (it " returns list of ignored files"
357383 (spy-on 'projectile-project-root :and-return-value " /path/to/project" )
0 commit comments