[#232] better error when requiring unknown namespace

This commit is contained in:
Michiel Borkent 2020-01-19 18:08:08 +01:00
parent 3f066210f2
commit e2cf871dfa
2 changed files with 5 additions and 1 deletions

View file

@ -14,7 +14,10 @@
"(require '[my-script :as ms]) (ms/foo)")))
(is (= "hello from foo\n"
(tu/bb nil "--classpath" "test-resources/babashka/src_for_classpath_test/foo.jar"
"(require '[foo :as f]) (f/foo)"))))
"(require '[foo :as f]) (f/foo)")))
(is (thrown-with-msg? Exception #"not require"
(tu/bb nil
"(require '[foo :as f])"))))
(deftest classpath-env-test
;; for this test you have to set `BABASHKA_CLASSPATH` to test-resources/babashka/src_for_classpath_test/env

View file

@ -8,6 +8,7 @@
(set! *warn-on-reflection* true)
(defn bb-jvm [input & args]
(reset! main/cp-state nil)
(let [os (java.io.StringWriter.)
es (java.io.StringWriter.)
is (when input