aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@batsov.com>2018-10-27 01:43:39 +0300
committerBozhidar Batsov <bozhidar@batsov.com>2018-10-27 01:43:39 +0300
commit6ea5275267bfd8281eb008ddcd77c1453586a675 (patch)
tree513bf7e8e410314bdea03d4e7d17c1e060e5ed06 /test
parentf8c59b21a867335fa35a4f69a9bd21d6a2c6bbb0 (diff)
Clean up some legacy from the tests
Diffstat (limited to 'test')
-rw-r--r--test/projectile-legacy-test.el55
-rw-r--r--test/projectile-test.el2
2 files changed, 1 insertions, 56 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
diff --git a/test/projectile-test.el b/test/projectile-test.el
index f273913..a1a646b 100644
--- a/test/projectile-test.el
+++ b/test/projectile-test.el
@@ -285,7 +285,7 @@ test temp directory"
(delete-directory (car directories))
(projectile--cleanup-known-projects)
(expect projectile-known-projects :to-equal (cdr directories)))
- (--each directories (ignore-errors (delete-directory it)))
+ (mapc (lambda (d) (ignore-errors (delete-directory it))) directories)
(delete-file projectile-known-projects-file nil)))))
(describe "projectile-project-root"