From 6ea5275267bfd8281eb008ddcd77c1453586a675 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Sat, 27 Oct 2018 01:43:39 +0300 Subject: Clean up some legacy from the tests --- Cask | 3 --- Makefile | 3 --- test/projectile-legacy-test.el | 55 ------------------------------------------ test/projectile-test.el | 2 +- 4 files changed, 1 insertion(+), 62 deletions(-) delete mode 100644 test/projectile-legacy-test.el diff --git a/Cask b/Cask index 647c1ff..0b6a125 100644 --- a/Cask +++ b/Cask @@ -4,7 +4,4 @@ (package-file "projectile.el") (development - (depends-on "ert-runner") - (depends-on "noflet") - (depends-on "dash") (depends-on "buttercup")) diff --git a/Makefile b/Makefile index f156583..52064b5 100644 --- a/Makefile +++ b/Makefile @@ -24,8 +24,5 @@ compile: $(OBJS) clean: rm -f $(OBJS) -ert-test: $(PKGDIR) - $(CASK) exec ert-runner $(TESTFLAGS) - test: $(PGKDIR) $(CASK) exec buttercup -L . 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" -- cgit v1.0