From 0530a98d32fd5e4aa761287a04fef64ba9f747c4 Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Sat, 30 Dec 2017 13:03:36 +0100 Subject: [PATCH] Test for expected error when previewing a non-file-visiting buffer MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This makes sure that the expected error isn’t masked by other kinds of failures (e.g. failing ‘markdown-command’). --- tests/markdown-test.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/markdown-test.el b/tests/markdown-test.el index 87ca7c1..3bc8ba5 100644 --- a/tests/markdown-test.el +++ b/tests/markdown-test.el @@ -5633,7 +5633,10 @@ x|" (markdown-mode) ;; Activating `markdown-live-preview-mode' signals error - (should-error (markdown-live-preview-mode)) + (let ((data (should-error (markdown-live-preview-mode) :type 'user-error))) + (should (string-match-p + (rx bos "Buffer " (+ nonl) " does not visit a file" eos) + (error-message-string data)))) ;; After trying to activate live preview mode, mode is not activated (should-not markdown-live-preview-mode) -- 2.11.4.GIT