Skip to content

Commit

Permalink
Improve two tests
Browse files Browse the repository at this point in the history
The next clause shouldn't be reached.
  • Loading branch information
dgutov committed Mar 15, 2024
1 parent 097a32c commit 45bb8ba
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ert/core-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,16 @@ end")
(ert-deftest jump-to-var-not-method-call ()
(with-temp-buffer
(insert "def foo\n abc = 1\n t.abc")
(should (equal
(nth 1 (should-error (robe-jump nil)))
"Method not found"))))
(cl-letf (((symbol-function 'robe-start) (lambda () (error "Not found"))))
(should (equal
(nth 1 (should-error (robe-jump nil)))
"Not found")))))

(ert-deftest jump-to-var-not-method-call-2 ()
(with-temp-buffer
(insert "def foo\n abc = abc()")
(forward-char -3)
(should (equal
(nth 1 (should-error (robe-jump nil)))
"Method not found"))))
(cl-letf (((symbol-function 'robe-start) (lambda () (error "Not found"))))
(should (equal
(nth 1 (should-error (robe-jump nil)))
"Not found")))))

0 comments on commit 45bb8ba

Please sign in to comment.