more tests

This commit is contained in:
Thomas von Dein
2017-07-19 11:25:57 +02:00
parent f1f278e844
commit 704207e307

View File

@@ -33,10 +33,17 @@
(require 'ert) (require 'ert)
(ert-deftest switch-text () (ert-deftest switch-text ()
;; start with empty *scratch*
(autoscratch-buffer) (autoscratch-buffer)
(should (string= major-mode "autoscratch-mode"))
;; should rename current scratch, create a new scratch in the
;; background and enable the correct mode
(insert "t") (insert "t")
(autoscratch--look-for-triggers nil) (autoscratch--look-for-triggers nil)
(should (string= major-mode "text-mode"))) (should (string= major-mode "text-mode"))
;; now we should be back to the previously "forked" scratch
(kill-buffer)
(should (string= major-mode "autoscratch-mode")))
(provide 'trigger-tests) (provide 'trigger-tests)