diff options
Diffstat (limited to 'test/projectile-legacy-test.el')
| -rw-r--r-- | test/projectile-legacy-test.el | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/test/projectile-legacy-test.el b/test/projectile-legacy-test.el deleted file mode 100644 index d749253..0000000 --- a/test/projectile-legacy-test.el +++ /dev/null @@ -1,55 +0,0 @@ -;;;;;;; Warning -;; -;; This file contains the project's legacy tests using the ERT framework. -;; We're in the process of moving those tests to Buttercup. -;; Don't add anything new here! - -(require 'projectile) -(require 'dash) -(require 'ert) -(require 'noflet) - -(defmacro projectile-test-with-sandbox (&rest body) - "Evaluate BODY in an empty temporary directory." - (declare (indent 0) (debug (&rest form))) - `(let ((sandbox - (--if-let (bound-and-true-p projectile-test-path) - (file-name-as-directory (expand-file-name "sandbox" it)) - (expand-file-name - (convert-standard-filename "test/sandbox/") - (file-name-directory (locate-library "projectile.el" t)))))) - (when (file-directory-p sandbox) - (delete-directory sandbox t)) - (make-directory sandbox t) - (let ((default-directory sandbox)) - ,@body))) - -(defmacro projectile-test-with-files (files &rest body) - (declare (indent 1) (debug (sexp &rest form))) - `(progn ,@(mapcar (lambda (file) - (if (string-suffix-p "/" file) - `(make-directory ,file t) - `(with-temp-file ,file))) - files) - ,@body)) - -(defun projectile-test-should-root-in (root directory) - (let ((projectile-project-root-cache (make-hash-table :test 'equal))) - (should (equal (file-truename (file-name-as-directory root)) - (let ((default-directory - (expand-file-name - (file-name-as-directory directory)))) - (file-truename (projectile-project-root))))))) - -(defun projectile-test-tmp-file-path () - "Return a filename suitable to save data to in the -test temp directory" - (concat projectile-test-path - "/tmp/temporary-file-" (format "%d" (random)) - ".eld")) - -;; Local Variables: -;; indent-tabs-mode: nil -;; End: - -;;; projectile-test.el ends here |
