Skip to content

Commit

Permalink
test: add a test to cover presence of buffer in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrieanKhisbe committed Oct 9, 2017
1 parent bcb1be0 commit 98cdc40
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions features/omni-scratch.feature
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@ Feature: Quickly edit some program
And I call with universal arg "omni-scratch"
Then I should be in buffer "*scratch:draft*"
And I should have 2 windows
And I should have "my-program" buffer as window
10 changes: 8 additions & 2 deletions features/step-definitions/omni-scratch-steps.el
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,11 @@
(execute-kbd-macro v))))

(Then "^I should have \\([0-9]+\\) windows$"
(lambda (nwindow)
(equal nwindow (length (get-buffer-window-list)))))
(lambda (nwindow)
(let ((windows (get-buffer-window-list)))
(eq nwindow (length windows)))))

(Then "^I should have \"\\([^\"]+\\)\" buffer as window$"
(lambda (buffername)
(member (mapcar (lambda (bn) (equal bn buffername))
(mapcar 'buffer-name (mapcar 'window-buffer (get-buffer-window-list)))) t)))

0 comments on commit 98cdc40

Please sign in to comment.