forked from Trevoke/org-gtd.el
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
70 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
(load "test/helpers/setup.el") | ||
(require 'org-gtd) | ||
(require 'buttercup) | ||
|
||
(describe | ||
"Engage view prefix width" | ||
|
||
:var ((inhibit-message t)) | ||
|
||
(before-each (ogt--configure-emacs)) | ||
(after-each (ogt--close-and-delete-files)) | ||
|
||
(it "adds ellipses if name is too long" | ||
(ogt-capture-and-process-project "My long project name which needs shortening") | ||
(let ((org-gtd-engage-prefix-width 17)) | ||
(org-gtd-engage)) | ||
(expect (ogt--buffer-string org-agenda-buffer) | ||
:to-match | ||
"My long project …")) | ||
|
||
(it "shortens prefix words if necessary" | ||
(ogt-capture-and-process-project "P234567890") | ||
(let ((org-gtd-engage-prefix-width 5)) | ||
(org-gtd-engage)) | ||
(expect (ogt--buffer-string org-agenda-buffer) | ||
:to-match | ||
"P234…")) | ||
|
||
(it "only shows ellipses if width is 1" | ||
(ogt-capture-and-process-project "P234567890") | ||
(let ((org-gtd-engage-prefix-width 1)) | ||
(org-gtd-engage)) | ||
(expect (ogt--buffer-string org-agenda-buffer) | ||
:to-match | ||
"^ …")) | ||
|
||
(it "shows the full project name without ellipses if it can" | ||
(ogt-capture-and-process-project "P234567890") | ||
(let ((org-gtd-engage-prefix-width 10)) | ||
(org-gtd-engage)) | ||
(org-gtd-engage) | ||
(expect (ogt--buffer-string org-agenda-buffer) | ||
:to-match | ||
"P234567890")) | ||
|
||
(it "adds as many spaces as needed" | ||
(ogt-capture-and-process-project "P234567890") | ||
(let ((org-gtd-engage-prefix-width 50)) | ||
(org-gtd-engage)) | ||
(expect (ogt--buffer-string org-agenda-buffer) | ||
:to-match | ||
"P234567890 "))) |