remove direct file deps from test

This commit is contained in:
jem 2020-01-30 12:11:13 +01:00
parent 4d638f84d9
commit 127fd9cbfe
2 changed files with 12 additions and 6 deletions

View file

@ -30,17 +30,17 @@
"" ""
"dummy"))) "dummy")))
(is (is
(Files/exists (ftt/verify-path-exists
(:java-path (:java-path
(sut/resource-from-cp-or-fs (sut/resource-from-cp-or-fs
"./test-resources" "./test-resources"
"templates/themes/bootstrap4-test" "templates/themes/bootstrap4-test"
"js")) sut/no-link-option)) "js"))))
(is (is
(Files/exists (ftt/verify-path-exists
(:java-path (:java-path
(sut/resource-from-cp-or-fs (sut/resource-from-cp-or-fs
"./" "" ".gitkeep")) sut/no-link-option)) "./" "" ".gitkeep"))))
(is (is
(some? (sut/resource-from-cp-or-fs (some? (sut/resource-from-cp-or-fs
"./test-resources" "./test-resources"

View file

@ -8,10 +8,16 @@
(ns cryogen-core.file-test-tools (ns cryogen-core.file-test-tools
(:require [clojure.java.io :as io] (:require [clojure.java.io :as io]
[schema.core :as s])) [schema.core :as s])
(:import [java.nio.file Files LinkOption]))
(def no-link-option (into-array [LinkOption/NOFOLLOW_LINKS]))
(defn verify-path-exists [path]
(Files/exists path no-link-option))
(defn verify-file-exists [path] (defn verify-file-exists [path]
(.exists (io/file path))) (io/file path))
(defn verify-dir-exists [path] (defn verify-dir-exists [path]
(and (verify-file-exists path) (and (verify-file-exists path)