[#232] better error when requiring unknown namespace
This commit is contained in:
parent
3f066210f2
commit
e2cf871dfa
2 changed files with 5 additions and 1 deletions
|
|
@ -14,7 +14,10 @@
|
||||||
"(require '[my-script :as ms]) (ms/foo)")))
|
"(require '[my-script :as ms]) (ms/foo)")))
|
||||||
(is (= "hello from foo\n"
|
(is (= "hello from foo\n"
|
||||||
(tu/bb nil "--classpath" "test-resources/babashka/src_for_classpath_test/foo.jar"
|
(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
|
(deftest classpath-env-test
|
||||||
;; for this test you have to set `BABASHKA_CLASSPATH` to test-resources/babashka/src_for_classpath_test/env
|
;; for this test you have to set `BABASHKA_CLASSPATH` to test-resources/babashka/src_for_classpath_test/env
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
(set! *warn-on-reflection* true)
|
(set! *warn-on-reflection* true)
|
||||||
|
|
||||||
(defn bb-jvm [input & args]
|
(defn bb-jvm [input & args]
|
||||||
|
(reset! main/cp-state nil)
|
||||||
(let [os (java.io.StringWriter.)
|
(let [os (java.io.StringWriter.)
|
||||||
es (java.io.StringWriter.)
|
es (java.io.StringWriter.)
|
||||||
is (when input
|
is (when input
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue