Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
psibi committed Aug 9, 2023
1 parent 544968a commit 2ad581c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions justl.el
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
(require 'compile)
(require 'comint)
(require 'subr-x)
(require 'tramp)

(defgroup justl nil
"Justfile customization group."
Expand Down
13 changes: 8 additions & 5 deletions test/justl-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
(should (equal
(list "default" "build-cmd" "plan" "push" "push2" "fail" "carriage-return"
"color")
(justl--get-recipies))))
(justl--get-recipies "./justfile"))))

(ert-deftest justl--list-to-recipe-test ()
(should (equal
Expand Down Expand Up @@ -257,25 +257,28 @@
(justl--wait-till-exit justl--output-process-buffer)
(with-current-buffer justl--output-process-buffer
(let ((buf-string (buffer-substring-no-properties (point-min) (point-max))))
(should (s-contains? "planner" buf-string)))))
(should (s-contains? "planner" buf-string))))
(kill-buffer justl--output-process-buffer))

(ert-deftest justl--execute-interactive-recipe-failure ()
"Checks justl-exec-recipe-in-dir indrectly (failure case)."
(justl--exec-without-justfile "just" (list "plan_non_existent"))
(justl--wait-till-exit justl--output-process-buffer)
(with-current-buffer justl--output-process-buffer
(let ((buf-string (buffer-substring-no-properties (point-min) (point-max))))
(should (s-contains? "exited abnormally" buf-string)))))
(should (s-contains? "exited abnormally" buf-string))))
(kill-buffer justl--output-process-buffer))

(ert-deftest justl--execute-interactive-recipe-multiple-args ()
"Checks justl-exec-recipe-in-dir indrectly (failure case)."
(justl--exec-without-justfile "just" (list "push2" "ver1" "ver2"))
(justl--wait-till-exit justl--output-process-buffer)
(with-current-buffer justl--output-process-buffer
(let ((buf-string (buffer-substring-no-properties (point-min) (point-max))))
(should (s-contains? "ver1" buf-string)))))
(should (s-contains? "ver1" buf-string))))
(kill-buffer justl--output-process-buffer))

;; (ert "justl--**")
(ert "justl--**")

(provide 'justl-test)
;;; justl-test.el ends here

0 comments on commit 2ad581c

Please sign in to comment.