aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNikita Bloshchanevich <nikblos@outlook.com>2020-08-22 10:22:48 +0200
committerGitHub <noreply@github.com>2020-08-22 11:22:48 +0300
commita2b5a70e204e277a738615901dfebf274c8202c2 (patch)
tree538acc09c50fdb4d10a0ba694c262c0ca8e672b2 /test
parent2a3b9a562051e3469cd62b561e3b8e225a6b0c14 (diff)
Add a couple of utility functions
- Add projectile-acquire-root, providing the common (projectile-ensure-project (projectile-project-root)) idiom - Add projectile-process-current-project-buffers-current: like projectile-process-current-project-buffers, but calling ACTION without arguments and with the buffer current
Diffstat (limited to 'test')
-rw-r--r--test/projectile-test.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/projectile-test.el b/test/projectile-test.el
index 39ce1f8..745e74b 100644
--- a/test/projectile-test.el
+++ b/test/projectile-test.el
@@ -1470,3 +1470,20 @@ You'd normally combine this with `projectile-test-with-sandbox'."
(projectile-dir-files-native "projectA/")
(expect 'projectile-ignored-files :to-have-been-called-times 1)
(expect 'projectile-ignored-directories :to-have-been-called-times 1)))))
+
+(describe "projectile-process-current-project-buffers-current"
+ (it "expects projectile-process-current-project-buffers and
+projectile-process-current-project-buffers-current to have similar behaviour"
+ (projectile-test-with-sandbox
+ (projectile-test-with-files
+ ("projectA/"
+ "projectA/.projectile"
+ "projectA/bufferA"
+ "projectA/fileA"
+ "projectA/dirA/"
+ "projectA/dirA/fileC")
+ (let ((list-a '())
+ (list-b '()))
+ (projectile-process-current-project-buffers (lambda (b) (push b list-a)))
+ (projectile-process-current-project-buffers-current (lambda () (push (current-buffer) list-b)))
+ (expect list-a :to-equal list-b))))))