cryogen-core/test/cryogen_core/classpath_able_io_test.clj

28 lines
877 B
Clojure
Raw Normal View History

2019-11-29 15:29:58 +00:00
(ns cryogen-core.classpath-able-io-test
(:require [clojure.test :refer :all]
[clojure.string :as s]
2019-11-29 15:44:29 +00:00
[clojure.java.io :as io]
[cryogen-core.classpath-able-io :as sut]))
2019-11-29 15:29:58 +00:00
(def theme "bootstrap4-test")
(def target "target/tmp")
2019-11-29 15:44:29 +00:00
(defn verify-file-exists [path]
(.exists (io/file path)))
(defn verify-dir-exists [path]
(and (verify-file-exists path)
(.isDirectory (io/file path))))
2019-12-03 16:51:21 +00:00
(deftest test-file-from-cp-or-filesystem
2019-12-03 17:11:30 +00:00
(is
(.exists (sut/file-from-cp-or-filesystem "./test-resources" "templates/themes/bootstrap4-test/js")))
(is
(.exists (sut/file-from-cp-or-filesystem "./" ".gitignore"))))
2019-12-03 16:51:21 +00:00
2019-11-29 15:29:58 +00:00
(deftest test-copy-resources-from-theme
(is (do
2019-11-29 15:44:29 +00:00
(sut/copy-resources-from-theme theme target)
(and (verify-dir-exists (str target "/js"))
(verify-file-exists (str target "/js/dummy.js"))))))