diff options
| author | Michal Nazarewicz | 2016-02-23 14:46:56 +1100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-02-23 14:46:56 +1100 |
| commit | d57ca9f8519ac1b0054857ad57653b2bdb1196ea (patch) | |
| tree | 6c7f615d3027c533f9193cae12d3d58df91f4072 /test/lisp/vc | |
| parent | a77c6799c1f3ae30c8bbf26aa376f52c33cd554f (diff) | |
| download | emacs-d57ca9f8519ac1b0054857ad57653b2bdb1196ea.tar.gz emacs-d57ca9f8519ac1b0054857ad57653b2bdb1196ea.zip | |
Make use of the `ert-with-function-mocked' macro
* test/lisp/calendar/icalendar-tests.el (icalendar--create-uid):
* test/lisp/vc/vc-bzr-tests.el (vc-bzr-test-bug9781): Use
`ert-with-function-mocked' instead of implementing the fragile
`unwind-protect' logic openly.
Diffstat (limited to 'test/lisp/vc')
| -rw-r--r-- | test/lisp/vc/vc-bzr-tests.el | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/test/lisp/vc/vc-bzr-tests.el b/test/lisp/vc/vc-bzr-tests.el index 82721eeee4e..98d176ca1ee 100644 --- a/test/lisp/vc/vc-bzr-tests.el +++ b/test/lisp/vc/vc-bzr-tests.el | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | ;;; Code: | 25 | ;;; Code: |
| 26 | 26 | ||
| 27 | (require 'ert) | 27 | (require 'ert) |
| 28 | (require 'ert-x) | ||
| 28 | (require 'vc-bzr) | 29 | (require 'vc-bzr) |
| 29 | (require 'vc-dir) | 30 | (require 'vc-dir) |
| 30 | 31 | ||
| @@ -101,12 +102,8 @@ | |||
| 101 | (while (vc-dir-busy) | 102 | (while (vc-dir-busy) |
| 102 | (sit-for 0.1)) | 103 | (sit-for 0.1)) |
| 103 | (vc-dir-mark-all-files t) | 104 | (vc-dir-mark-all-files t) |
| 104 | (let ((f (symbol-function 'y-or-n-p))) | 105 | (ert-with-function-mocked y-or-n-p (lambda (_) t) |
| 105 | (unwind-protect | 106 | (vc-next-action nil)) |
| 106 | (progn | ||
| 107 | (fset 'y-or-n-p (lambda (prompt) t)) | ||
| 108 | (vc-next-action nil)) | ||
| 109 | (fset 'y-or-n-p f))) | ||
| 110 | (should (get-buffer "*vc-log*"))) | 107 | (should (get-buffer "*vc-log*"))) |
| 111 | (delete-directory homedir t)))) | 108 | (delete-directory homedir t)))) |
| 112 | 109 | ||