Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
agzam committed Dec 7, 2024
1 parent 4571b46 commit cb36308
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions neil-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
(describe "neil-find-clojure-package, no neil"
(it "throws error when neil cmd-line executable not found"
(spy-on #'executable-find :and-return-value nil)
(expect (funcall #'neil-find-clojure-package "foo") :to-throw 'error)))
(expect (funcall #'neil--find-exe) :to-throw 'error)))

(describe "neil-find-clojure-package, happy path"
:var (prompt-calls shell-cmd-calls)
Expand All @@ -41,13 +41,13 @@
(setf shell-cmd-calls (1+ shell-cmd-calls))
(cond
((eq shell-cmd-calls 1)
(expect command :to-equal "/bin/neil dep search test-pkg")
(expect command :to-equal (concat (neil--find-exe) " dep search test-pkg"))
(concat
":lib foo/test-pkg :version \"1.0.0\" :description \"good lib\"\n"
":lib bar/awesome-test-pkg :version \"2.1.0\" :description \"better lib\"\n"))

((eq shell-cmd-calls 2)
(expect command :to-equal "/bin/neil dep versions foo/test-pkg")
(expect command :to-equal (concat (neil--find-exe) " dep versions foo/test-pkg"))
(concat
":lib foo/test-pkg :version \"1.0.0\"\n"
":lib bar/awesome-test-pkg :version \"2.1.0\"\n")))))
Expand Down Expand Up @@ -80,6 +80,11 @@
(it "shouldn't throw 'executable not found' error"
(expect (neil-find-clojure-package "test-pkg") :not :to-throw))

(it "should work for clj -M:neil"
(let* ((neil-executable-path "clj -M:neil"))
(expect (neil-find-clojure-package "test-pkg") :to-equal
"foo/test-pkg {:mvn/version \"1.0.0\"}")))

(it "for clojure-cli, without version prompt"
(spy-on #'neil--identify-project-build-tool :and-return-value '(clojure-cli))
(let ((neil-prompt-for-version-p nil))
Expand Down

0 comments on commit cb36308

Please sign in to comment.