mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-23 19:40:24 +10:00
Moving to Doom Emacs!
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; ui/doom-dashboard/test/test-doom-dashboard.el
|
||||
|
||||
(require 'core-projects)
|
||||
(require 'projectile)
|
||||
(require! :ui doom-dashboard)
|
||||
|
||||
(describe "ui/doom-dashboard"
|
||||
:var (default-directory projectile-enable-caching)
|
||||
(before-all
|
||||
(setq projectile-enable-caching nil
|
||||
doom-fallback-buffer-name +doom-dashboard-name))
|
||||
|
||||
(before-each (projectile-mode +1))
|
||||
(after-each (projectile-mode -1))
|
||||
|
||||
(describe "get-pwd"
|
||||
:var (+doom-dashboard--last-cwd)
|
||||
(before-each
|
||||
(setq +doom-dashboard--last-cwd doom-core-dir
|
||||
default-directory doom-core-dir))
|
||||
(it "returns the current directory when policy is nil"
|
||||
(let (+doom-dashboard-pwd-policy)
|
||||
(expect (+doom-dashboard--get-pwd) :to-equal default-directory)))
|
||||
(it "returns a path if policy is a path"
|
||||
(let ((+doom-dashboard-pwd-policy "~"))
|
||||
(expect (+doom-dashboard--get-pwd) :to-equal (expand-file-name "~"))))
|
||||
(it "returns return value of policy as a function"
|
||||
(let ((+doom-dashboard-pwd-policy (lambda (x) "x")))
|
||||
(expect (+doom-dashboard--get-pwd) :to-equal "x")))
|
||||
(it "returns last cwd if policy is 'last"
|
||||
(let ((+doom-dashboard-pwd-policy 'last))
|
||||
(expect (+doom-dashboard--get-pwd) :to-equal doom-core-dir)))
|
||||
(it "returns last project if policy is 'last-project"
|
||||
(let ((+doom-dashboard-pwd-policy 'last-project))
|
||||
(expect (+doom-dashboard--get-pwd) :to-equal doom-emacs-dir))))
|
||||
|
||||
(describe "dashboard-p"
|
||||
(it "changes the fallback buffer to the dashboard buffer"
|
||||
(expect (+doom-dashboard-p (doom-fallback-buffer))))))
|
||||
Reference in New Issue
Block a user