Skip to content

Commit

Permalink
tweak ivy-read test
Browse files Browse the repository at this point in the history
  • Loading branch information
jacktasia committed Aug 21, 2016
1 parent 29ff880 commit 6dd3fce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dumb-jump.el
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ Optionally pass t to see a list of all failed rules"
(s-trim (plist-get result :context))))
results)))
(if (and (eq dumb-jump-selector 'ivy) (fboundp 'ivy-read))
(ivy-read "Jump to: " choices :action (lambda (x) (dumb-jump-to-selected results choices x)))
(dumb-jump-to-selected results choices (ivy-read "Jump to: " choices))
(dumb-jump-to-selected results choices (popup-menu* choices)))))

(defun dumb-jump-get-project-root (filepath)
Expand Down
3 changes: 2 additions & 1 deletion test/dumb-jump-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@
(results '((:path "/usr/blah/test.txt" :line 54 :context "function thing()")
(:path "/usr/blah/test2.txt" :line 52 :context "var thing = function()" :target "a"))))
(with-mock
(mock (ivy-read "Jump to: " * :action *))
(mock (ivy-read * *) => "/test2.txt:52 var thing = function()")
(mock (dumb-jump-result-follow '(:path "/usr/blah/test2.txt" :line 52 :context "var thing = function()" :target "a")))
(dumb-jump-prompt-user-for-choice "/usr/blah" results))))

(ert-deftest dumb-jump-a-back-test ()
Expand Down

0 comments on commit 6dd3fce

Please sign in to comment.