"Temporary directory for Tramp tests.")
(setq password-cache-expiry nil
- shadow-debug nil
+ shadow-debug t
tramp-verbose 0
tramp-message-show-message nil)
(set-buffer-modified-p nil)
(kill-buffer))
;; Delete buffers.
- (when (buffer-live-p shadow-info-buffer)
+ (ignore-errors
(with-current-buffer shadow-info-buffer
(set-buffer-modified-p nil)
(kill-buffer)))
- (when (buffer-live-p shadow-todo-buffer)
+ (ignore-errors
(with-current-buffer shadow-todo-buffer
(set-buffer-modified-p nil)
(kill-buffer)))
((symbol-function 'read-string)
(lambda (&rest args) (pop mocked-input))))
- ;; Cleanup.
+ ;; Cleanup & initialize.
(shadow--tests-cleanup)
+ (shadow-initialize)
;; Define a cluster.
(setq cluster "cluster"
((symbol-function 'read-string)
(lambda (&rest args) (pop mocked-input))))
- ;; Cleanup.
+ ;; Cleanup & initialize.
(shadow--tests-cleanup)
+ (shadow-initialize)
;; Define a cluster.
(setq cluster1 "cluster1"
cluster primary regexp file hup)
(unwind-protect
(progn
- ;; Cleanup.
+
+ ;; Cleanup & initialize.
(shadow--tests-cleanup)
+ (shadow-initialize)
;; Define a cluster.
(setq cluster "cluster"
cluster primary regexp file1 file2)
(unwind-protect
(progn
- ;; Cleanup.
+
+ ;; Cleanup & initialize.
(shadow--tests-cleanup)
+ (shadow-initialize)
;; Define a cluster.
(setq cluster "cluster"
cluster primary regexp file)
(unwind-protect
(progn
- ;; Cleanup.
+
+ ;; Cleanup & initialize.
(shadow--tests-cleanup)
+ (shadow-initialize)
;; Define a cluster.
(setq cluster "cluster"
cluster primary regexp file)
(unwind-protect
(progn
- ;; Cleanup.
+
+ ;; Cleanup & initialize.
(shadow--tests-cleanup)
+ (shadow-initialize)
;; Define a cluster.
(setq cluster "cluster"
((symbol-function 'read-string)
(lambda (&rest args) (pop mocked-input))))
- ;; Cleanup.
+ ;; Cleanup & initialize.
(shadow--tests-cleanup)
+ (shadow-initialize)
;; Define clusters.
(setq cluster1 "cluster1"
((symbol-function 'read-string)
(lambda (&rest args) (pop mocked-input))))
- ;; Cleanup.
+ ;; Cleanup & initialize.
(shadow--tests-cleanup)
+ (shadow-initialize)
;; Define clusters.
(setq cluster1 "cluster1"
cluster1 cluster2 primary regexp file)
(unwind-protect
(progn
- ;; Cleanup.
+
+ ;; Cleanup & initialize.
(shadow--tests-cleanup)
+ (shadow-initialize)
;; Define clusters.
(setq cluster1 "cluster1"
shadow-files-to-copy)))
;; Cleanup.
- (ignore-errors (delete-file file))
- (ignore-errors (delete-file (concat (shadow-site-primary cluster2) file)))
+ (dolist (elt `(,file ,(concat (shadow-site-primary cluster2) file)))
+ (ignore-errors
+ (with-current-buffer (get-file-buffer elt)
+ (set-buffer-modified-p nil)
+ (kill-buffer)))
+ (ignore-errors (delete-file elt)))
(shadow--tests-cleanup))))
(ert-deftest shadow-test09-shadow-copy-files ()
cluster1 cluster2 primary regexp file mocked-input)
(unwind-protect
(progn
- ;; Cleanup.
+
+ ;; Cleanup & initialize.
(shadow--tests-cleanup)
+ (shadow-initialize)
;; Define clusters.
(setq cluster1 "cluster1"
;; Cleanup.
(remove-function (symbol-function 'write-region) "write-region-mock")
- (ignore-errors (delete-file file))
- (ignore-errors (delete-file (concat (shadow-site-primary cluster2) file)))
+ (dolist (elt `(,file ,(concat (shadow-site-primary cluster2) file)))
+ (ignore-errors
+ (with-current-buffer (get-file-buffer elt)
+ (set-buffer-modified-p nil)
+ (kill-buffer)))
+ (ignore-errors (delete-file elt)))
(shadow--tests-cleanup))))
(defun shadowfile-test-all (&optional interactive)
(ert-run-tests-interactively "^shadowfile-")
(ert-run-tests-batch "^shadowfile-")))
-(let ((shadow-info-file shadow-test-info-file)
- (shadow-todo-file shadow-test-todo-file))
- (shadow--tests-cleanup)
- (shadow-initialize))
-
(provide 'shadowfile-tests)
;;; shadowfile-tests.el ends here