Add babashka.curl test
This commit is contained in:
parent
2fb4156d69
commit
01aa97847b
2 changed files with 34 additions and 0 deletions
33
script/lib_tests/babashka_curl_test
Executable file
33
script/lib_tests/babashka_curl_test
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
export BABASHKA_CLASSPATH=$(clojure -Sdeps '{:deps {babasha.curl {:git/url "https://github.com/borkdude/babashka.curl" :sha "1ec005d0c11d316bc5e6ab38e34546c75055f33b"}}}' -Spath)
|
||||
|
||||
if [ "$BABASHKA_TEST_ENV" = "native" ]; then
|
||||
BB_CMD="./bb"
|
||||
else
|
||||
BB_CMD="lein bb"
|
||||
fi
|
||||
|
||||
$BB_CMD -e "
|
||||
(require '[babashka.curl :as curl])
|
||||
|
||||
(prn (subs (curl/get \"https://www.clojure.org\") 0 10))
|
||||
|
||||
(prn (subs (curl/get \"https://postman-echo.com/get?foo1=bar1&foo2=bar2\") 0 10))
|
||||
|
||||
(prn (subs (curl/post \"https://postman-echo.com/post\") 0 10))
|
||||
|
||||
(prn (subs (curl/post \"https://postman-echo.com/post\"
|
||||
{:body (json/generate-string {:a 1})
|
||||
:headers {\"X-Hasura-Role\" \"admin\"}
|
||||
:content-type :json
|
||||
:accept :json}) 0 10))
|
||||
|
||||
(prn (subs (curl/put \"https://postman-echo.com/put\"
|
||||
{:body (json/generate-string {:a 1})
|
||||
:headers {\"X-Hasura-Role\" \"admin\"}
|
||||
:content-type :json
|
||||
:accept :json}) 0 10))
|
||||
"
|
||||
|
|
@ -8,3 +8,4 @@ script/lib_tests/spartan_spec_test
|
|||
script/lib_tests/clojure_csv_test
|
||||
script/lib_tests/regal_test
|
||||
script/lib_tests/medley_test
|
||||
script/lib_tests/babashka_curl_test
|
||||
|
|
|
|||
Loading…
Reference in a new issue