Skip to content

Commit

Permalink
move more tests over to el-mock
Browse files Browse the repository at this point in the history
  • Loading branch information
jacktasia committed Apr 3, 2016
1 parent 74777f8 commit 2c08243
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions test/dumb-jump-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -322,29 +322,19 @@
(goto-char (point-min))
(forward-line 21)
(forward-char 33)
(noflet ((dumb-jump-handle-results (a b c d e f)
(should (= (length a) 3))
(funcall this-fn a b c d e f))
(dumb-jump-result-follow (result use-tooltip proj)
(should-not use-tooltip)
(should (string= (plist-get result :path) el-file))
(should (= (plist-get result :line) 18))))
(dumb-jump-go)))))
(with-mock
(mock (dumb-jump-goto-file-line * 18 10))
(should (string= el-file (dumb-jump-go)))))))

(ert-deftest dumb-jump-go-var-arg-test ()
(let ((el-file (f-join test-data-dir-elisp "fake2.el")))
(with-current-buffer (find-file-noselect el-file t)
(goto-char (point-min))
(forward-line 4)
(forward-char 12)
(noflet ((dumb-jump-handle-results (a b c d e f)
(should (= (length a) 3))
(funcall this-fn a b c d e f))
(dumb-jump-result-follow (result use-tooltip proj)
(should-not use-tooltip)
(should (string= (plist-get result :path) el-file))
(should (= (plist-get result :line) 3))))
(dumb-jump-go)))))
(with-mock
(mock (dumb-jump-goto-file-line * 3 27))
(should (string= el-file (dumb-jump-go)))))))

(ert-deftest dumb-jump-back-test ()
(let ((js-file (f-join test-data-dir-proj1 "src" "js" "fake2.js"))
Expand Down

0 comments on commit 2c08243

Please sign in to comment.