babashka/test/babashka/impl/clojure/java/shell_test.clj
Bob 35e2cd9d05
make tests run on windows as the default (#235) (#898)
* make tests run on windows as the default

- change from selecting tests to run to selecting tests to skip (remove all :windows tags, add
  :skip-windows tag to tests that don't currently work on windows)
- handfuls of calls to `normalize` and `escape-file-paths` to handle platform differences
- split `task-test` to make most of the tests run on windows, and exclude just a couple of Unix-y tests

* make a binding name clearer

* skip nrepl-server-test on Windows

- test fails on CI, so disabling it for now

* unset bb environment vars after running tests

* unset bb environment var after running release-artifact

BABASHKA_EDN being set can interfere with some tests, so unset it before running the
native tests

* skip uberjar test on Windows

uberjar-test's 'throw on empty classpath' test failing on Windows native
 (but passes on JVM) - skip it for now
2021-06-20 09:23:58 +02:00

17 lines
563 B
Clojure

(ns babashka.impl.clojure.java.shell-test
(:require [clojure.test :as t :refer [deftest is testing]]
[babashka.test-utils :as test-utils]
[clojure.string :as str]))
(deftest ^:skip-windows with-sh-env-test
(is (= "\"BAR\""
(str/trim (test-utils/bb nil "
(-> (shell/with-sh-env {:FOO \"BAR\"}
(shell/sh \"bash\" \"-c\" \"echo $FOO\"))
:out
str/trim)"))))
(is (str/includes? (str/trim (test-utils/bb nil "
(-> (shell/with-sh-dir \"logo\"
(shell/sh \"ls\"))
:out)"))
"icon.svg")))