branch: elpa/lua-mode
commit 1135932247cc71b90660d51fd494175f73ddbc17
Author: Nikita Bloshchanevich <[email protected]>
Commit: Nikita Bloshchanevich <[email protected]>
test-process: check if the buffer switching works
---
test/test-process.el | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/test/test-process.el b/test/test-process.el
index a66bfcf..bedb11c 100644
--- a/test/test-process.el
+++ b/test/test-process.el
@@ -9,13 +9,16 @@
(describe "`lua-start-process'"
(it "doesn't hang for an already-running process"
;; Acquire a *lua* repl buffer
- (lua-start-process)
- ;; Input some text
- (with-current-buffer lua-process-buffer
- (insert "table.insert"))
- ;; Try restarting the repl buffer
- (lua-start-process)
- ;; `lua-start-process' shouldn't hang
- (expect t)))
+ (save-current-buffer
+ (funcall-interactively #'lua-start-process)
+ ;; Input some text
+ (with-current-buffer lua-process-buffer
+ (insert "table.insert"))
+ (switch-to-buffer (get-buffer-create "*scratch*"))
+ ;; Try restarting the repl buffer
+ (funcall-interactively #'lua-start-process)
+
+ ;; `lua-start-process' shouldn't hang, and it should have switched back.
+ (expect (current-buffer) :to-be lua-process-buffer))))
;;; test-process.el ends here