This repository has been archived by the owner on Jul 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
peep-dired-kill-buffers-without-window
(#4)
- Loading branch information
Showing
4 changed files
with
54 additions
and
22 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 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 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 |
---|---|---|
@@ -1,54 +1,62 @@ | ||
(Given "^I open dired buffer in the root directory$" | ||
(lambda () | ||
(dired peep-dired-root-path))) | ||
(dired peep-dired-root-path))) | ||
|
||
(And "^I place cursor on \"\\(.+\\)\" entry$" | ||
(lambda (filename) | ||
(goto-char 0) | ||
(while (not (string= (dired-get-filename nil t) | ||
(expand-file-name filename))) | ||
(forward-line 1)))) | ||
(expand-file-name filename))) | ||
(forward-line 1)))) | ||
|
||
(When "^I run \"\\(.+\\)\"$" | ||
(lambda (command ) | ||
(When "I start an action chain") | ||
(When "I press \"M-x\"") | ||
(And (s-lex-format "I type \"${command}\"")) | ||
(When "I press \"RET\"") | ||
(And "I execute the action chain"))) | ||
(When "I start an action chain") | ||
(When "I press \"M-x\"") | ||
(And (s-lex-format "I type \"${command}\"")) | ||
(When "I press \"RET\"") | ||
(And "I execute the action chain"))) | ||
|
||
(When "^I go down$" | ||
(lambda () | ||
(forward-line 1))) | ||
(forward-line 1))) | ||
|
||
(When "^I go up$" | ||
(lambda () | ||
(forward-line -1))) | ||
(forward-line -1))) | ||
|
||
(Then "^I should scroll down \"\\(.+\\)\" buffer in other window$" | ||
(lambda (buffername) | ||
(should (not (eq (window-start (get-buffer-window buffername)) 1))))) | ||
(should (not (eq (window-start (get-buffer-window buffername)) 1))))) | ||
|
||
(Then "^I should scroll up \"\\(.+\\)\" buffer in other window$" | ||
(lambda (buffername) | ||
(should (eq (window-start (get-buffer-window buffername)) 1)))) | ||
(should (eq (window-start (get-buffer-window buffername)) 1)))) | ||
|
||
(Then "^the peeped buffers should be killed$" | ||
(lambda () | ||
(should (eq () peep-dired-peeped-buffers)))) | ||
(Then "^the peeped buffer \"\\(.+\\)\" should be killed$" | ||
(lambda (buffername) | ||
(should (not (member buffername (mapcar 'buffer-name (buffer-list))))))) | ||
|
||
(Then "^the peeped buffer \"\\(.+\\)\" should not be killed$" | ||
(lambda (buffername) | ||
(should (member buffername (mapcar 'buffer-name (buffer-list)))))) | ||
|
||
(Then "the only visible windows are \"\\(.+\\)\" and \"\\(.+\\)\"" | ||
(lambda (dired-buffer peeped-buffer) | ||
(should (equal | ||
(list | ||
(get-buffer-window dired-buffer) | ||
(get-buffer-window peeped-buffer)) | ||
(window-list))))) | ||
(should (equal | ||
(list | ||
(get-buffer-window dired-buffer) | ||
(get-buffer-window peeped-buffer)) | ||
(window-list))))) | ||
|
||
(Given "^I open \"\\(.+\\)\" file$" | ||
(lambda (filename) | ||
(find-file (expand-file-name filename peep-dired-root-path)))) | ||
(find-file (expand-file-name filename peep-dired-root-path)))) | ||
|
||
(Then "^the peeped buffers should be killed$" | ||
(lambda () | ||
(should (eq () peep-dired-peeped-buffers)))) | ||
|
||
(Then "^key \"\\(.+\\)\" should be mapped to \"\\(.+\\)\"$" | ||
(lambda (key command) | ||
(should (equal (key-binding (kbd key)) (intern command))))) | ||
(should (equal (key-binding (kbd key)) (intern command))))) |
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