Skip to content

Commit

Permalink
consistency: add dir context for macos/linux test
Browse files Browse the repository at this point in the history
  • Loading branch information
lread committed Jul 25, 2024
1 parent dd93ac1 commit db938a5
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions test/babashka/process_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -189,23 +189,24 @@
;; see also babashka.process-exec-test/resolve-program-macos-linux-test
(deftest process-resolve-program-macos-linux-test
(doseq [{:keys [dir expected-workdir]} (dirs-for [nil :workdir])]
(u/with-program-scenario {:cwd [:sh]
:workdir [:sh]
:on-path [:sh]}
(doseq [[program expected-exedir]
[[(u/test-program :sh) :on-path]
[(str "./" (u/test-program :sh)) expected-workdir]
[(u/test-program-abs :workdir :sh) :workdir]]
:let [desc (format "program: %s expected-exedir %s" program expected-exedir)]]
(is (= (u/etpo {:exedir expected-exedir
:exename (u/test-program :sh)
:workdir expected-workdir})
(plines program dir))
desc)))
(u/with-program-scenario {:cwd [:sh]
:workdir [:sh]}
(is (thrown-with-msg? Exception #"No such file"
(plines (u/test-program :sh) dir)))))))
(testing (format "dir: %s" (or dir "<not specified>"))
(u/with-program-scenario {:cwd [:sh]
:workdir [:sh]
:on-path [:sh]}
(doseq [[program expected-exedir]
[[(u/test-program :sh) :on-path]
[(str "./" (u/test-program :sh)) expected-workdir]
[(u/test-program-abs :workdir :sh) :workdir]]
:let [desc (format "program: %s expected-exedir %s" program expected-exedir)]]
(is (= (u/etpo {:exedir expected-exedir
:exename (u/test-program :sh)
:workdir expected-workdir})
(plines program dir))
desc)))
(u/with-program-scenario {:cwd [:sh]
:workdir [:sh]}
(is (thrown-with-msg? Exception #"No such file"
(plines (u/test-program :sh) dir))))))))

(when (fs/windows?)
;; see also babashka.process-exec-test/resolve-program-win-test
Expand Down

0 comments on commit db938a5

Please sign in to comment.