diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/projectile-test.el | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/projectile-test.el b/test/projectile-test.el index 0d56c57..32b915d 100644 --- a/test/projectile-test.el +++ b/test/projectile-test.el @@ -28,6 +28,7 @@ (require 'projectile) (require 'buttercup) + (message "Running tests on Emacs %s" emacs-version) ;; TODO: Revise this init logic @@ -643,6 +644,32 @@ You'd normally combine this with `projectile-test-with-sandbox'." (expect (projectile-project-root) :to-equal correct-project-root)))))) (describe "projectile-grep" + (describe "multi-root grep" + (after-each + (cl-flet ((grep-buffer-p (b) (string-prefix-p "*grep" (buffer-name b)))) + (let ((grep-buffers (cl-remove-if-not #'grep-buffer-p (buffer-list)))) + (dolist (grep-buffer grep-buffers) + (let ((kill-buffer-query-functions nil)) + (kill-buffer grep-buffer)))))) + (it "grep multi-root projects" + (projectile-test-with-sandbox + (projectile-test-with-files + ("project/bar/" + "project/baz/") + (cd "project") + (with-temp-file ".projectile" (insert (concat "+/baz\n" + "+/bar\n"))) + (with-temp-file "foo.txt" (insert "hi")) + (with-temp-file "bar/bar.txt" (insert "hi")) + (with-temp-file "baz/baz.txt" (insert "hi")) + (with-current-buffer (find-file-noselect ".projectile" t) + (let ((grep-find-template "<X>") + grep-find-ignored-directories grep-find-ignored-files + projectile-globally-ignored-files + projectile-globally-ignored-file-suffixes + projectile-globally-ignored-directories) + (projectile-grep "hi"))))))) + (describe "rgrep" (before-each (spy-on 'compilation-start)) |
