Add print-deps test
This commit is contained in:
parent
42f12ba75b
commit
2079f0a554
2 changed files with 21 additions and 2 deletions
|
|
@ -14,8 +14,10 @@
|
|||
edn/read-string)
|
||||
deps (:deps deps)
|
||||
deps (assoc deps
|
||||
'babashka/fs {:mvn/version "0.0.5"}
|
||||
'babashka/babashka.curl {:mvn/version "0.0.3"})
|
||||
'babashka/fs {:mvn/version "0.1.2"}
|
||||
'babashka/babashka.curl {:mvn/version "0.1.1"}
|
||||
'babashka/babashka.core {:git/url "https://github.com/babashka/babashka.core"
|
||||
:git/sha "52a6037bd4b632bffffb04394fb4efd0cdab6b1e"})
|
||||
deps (dissoc deps
|
||||
'borkdude/sci
|
||||
'borkdude/graal.locking
|
||||
|
|
|
|||
17
test/babashka/print_deps_test.clj
Normal file
17
test/babashka/print_deps_test.clj
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
(ns babashka.print-deps-test
|
||||
(:require [babashka.deps :as deps]
|
||||
[babashka.fs :as fs]
|
||||
[babashka.test-utils :refer [bb]]
|
||||
[clojure.string :as str]
|
||||
[clojure.test :refer [deftest is testing]]
|
||||
[sci.core :as sci]))
|
||||
|
||||
(deftest print-deps-test
|
||||
(let [deps (bb nil "print-deps" "--format" "deps")
|
||||
tmp-dir (fs/create-temp-dir)]
|
||||
(testing "printed deps map can be read by Clojure"
|
||||
(spit (fs/file tmp-dir "deps.edn") deps)
|
||||
(let [cp (sci/with-out-str
|
||||
(deps/clojure ["-Spath"] {:dir (str tmp-dir)}))]
|
||||
(is (str/includes? cp "babashka.curl")))
|
||||
(fs/delete-tree tmp-dir))))
|
||||
Loading…
Reference in a new issue