[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ssh-deploy c7407ef 069/133: Using (kill-buffer) instead
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ssh-deploy c7407ef 069/133: Using (kill-buffer) instead of reverting default-directory in unit tests |
Date: |
Sat, 27 Mar 2021 14:48:45 -0400 (EDT) |
branch: externals/ssh-deploy
commit c7407ef2d549a54922e8d4966754aeca3dbda06e
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Using (kill-buffer) instead of reverting default-directory in unit tests
---
ssh-deploy-test.el | 71 ++++++++++++++++++++++++------------------------------
1 file changed, 31 insertions(+), 40 deletions(-)
diff --git a/ssh-deploy-test.el b/ssh-deploy-test.el
index b380a6f..8c96b39 100644
--- a/ssh-deploy-test.el
+++ b/ssh-deploy-test.el
@@ -71,24 +71,20 @@
ssh-deploy-verbose
ssh-deploy-debug)
- (let ((old-default-directory default-directory))
-
- ;; Create a new file and add it's contents
- (find-file file-b)
- (insert file-b-contents)
- (save-buffer)
-
- ;; Download file
- (ssh-deploy-download file-b file-a 0 nil 0)
+ ;; Create a new file and add it's contents
+ (find-file file-b)
+ (insert file-b-contents)
+ (save-buffer)
+ (kill-buffer)
- ;; Verify that both files have equal contents
- (should (equal t (ediff-same-file-contents file-a file-b)))
+ ;; Download file
+ (ssh-deploy-download file-b file-a 0 nil 0)
- (delete-file file-b)
- (delete-file file-a)
+ ;; Verify that both files have equal contents
+ (should (equal t (ediff-same-file-contents file-a file-b)))
- ;; (find-file) changes default-directory so we revert it here
- (setq default-directory old-default-directory))))
+ (delete-file file-b)
+ (delete-file file-a)))
(delete-directory directory-a t)
(delete-directory directory-b t)))
@@ -128,38 +124,33 @@
ssh-deploy-verbose
ssh-deploy-debug)
- ;; Create a new file and add it's contents
- (let ((old-default-directory default-directory))
+ (ssh-deploy-add-after-save-hook)
+ (find-file file-a)
+ (insert file-a-contents)
+ (save-buffer) ;; NOTE Should trigger upload action
- (ssh-deploy-add-after-save-hook)
- (find-file file-a)
- (insert file-a-contents)
- (save-buffer) ;; NOTE Should trigger upload action
+ ;; Verify that both files have equal contents
+ (should (equal t (ediff-same-file-contents file-a file-b)))
- ;; Verify that both files have equal contents
- (should (equal t (ediff-same-file-contents file-a file-b)))
-
- ;; Turn of automatic uploads
- (let ((ssh-deploy-on-explicit-save 0))
-
- ;; Update should not trigger upload
- (insert file-a-contents)
- (save-buffer)
+ ;; Turn of automatic uploads
+ (let ((ssh-deploy-on-explicit-save 0))
- ;; Verify that both files have equal contents
- (should (equal nil (ediff-same-file-contents file-a file-b)))
+ ;; Update should not trigger upload
+ (insert file-a-contents)
+ (save-buffer)
- (ssh-deploy-upload-handler)
+ ;; Verify that both files have equal contents
+ (should (equal nil (ediff-same-file-contents file-a file-b)))
- ;; Verify that both files have equal contents
- (should (equal t (ediff-same-file-contents file-a file-b)))
+ (ssh-deploy-upload-handler)
+ (kill-buffer)
- ;; Delete both test files
- (delete-file file-b)
- (delete-file file-a))
+ ;; Verify that both files have equal contents
+ (should (equal t (ediff-same-file-contents file-a file-b)))
- ;; (find-file) changes default-directory so we revert it here
- (setq default-directory old-default-directory))))
+ ;; Delete both test files
+ (delete-file file-b)
+ (delete-file file-a))))
(delete-directory directory-a t)
(delete-directory directory-b t)))
- [elpa] externals/ssh-deploy 3c5fe09 037/133: More work on diff mode cosmetic changes, (continued)
- [elpa] externals/ssh-deploy 3c5fe09 037/133: More work on diff mode cosmetic changes, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 95a932a 047/133: Started on unit-tests, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 0b43ceb 048/133: Added unit tests for get-revision-path and is-not-empty-string, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 4ff27e9 049/133: Minor modifications after suggestions from flycheck-package, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 5871711 052/133: Renamed TRAMP to Tramp and added link to lisp code style, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy e834379 053/133: Updated version, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 2388c00 056/133: Added -p suffix to predicate functions, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy bc93b81 057/133: Updated version, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 4c5b82a 062/133: Added hydra application as shortcut, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 0e98d8e 046/133: Removed unnecessary group, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy c7407ef 069/133: Using (kill-buffer) instead of reverting default-directory in unit tests,
Stefan Monnier <=
- [elpa] externals/ssh-deploy d9f61e1 071/133: Resolved byte-compilation with optional hydra feature, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy f2cdb1a 077/133: Started on asynchronous tests, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 1073a7c 078/133: Replace more (require) with (autoload), Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy d992624 087/133: More work on asynchronous unit test of detecting remote changes, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 3223f69 094/133: Updated Travis file, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 9b5d3d2 111/133: Fixed bug wih conditonal logic for async file diff, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy bebeaa1 100/133: Updated version to 3.1, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy c4fd187 039/133: Deletion working from diff-mode, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 88300e3 043/133: Improved wording of remote change detection, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy e08b8bb 044/133: Improved documentation, Stefan Monnier, 2021/03/27