dda-build/test/dda/build/image/domain_test.clj

33 lines
1.1 KiB
Clojure
Raw Normal View History

2024-07-26 15:46:51 +00:00
(ns dda.build.image.domain-test
(:require
[clojure.test :refer [deftest is are testing run-tests]]
[clojure.spec.test.alpha :as st]
[dda.build.image.domain :as cut]))
(st/instrument `cut/copy-image-command)
(st/instrument `cut/dbuild-command)
(deftest should-calculate-copy-image-command
(is (= ["cp" "-r" "image" "../../target/dda-backup"]
(cut/copy-image-command {:name "dda-backup"
:project-root-path "../.."
:build-dir-name "target"
:version "4.11.8-dev"
:stage "dev"}))))
(deftest should-calculate-dbuild-command
(is (= ["docker"
"build"
"-t"
"dda-backup"
"--file"
"../../target/dda-backup/image/Dockerfile"
"../../target/dda-backup/image"]
(cut/dbuild-command {:name "dda-backup"
:project-root-path "../.."
:build-dir-name "target"
:version "4.11.8-dev"
:stage "dev"}))))