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

48 lines
2 KiB
Clojure

(ns dda.build.devops.domain-test
(:require
[clojure.test :refer [deftest is are testing run-tests]]
[clojure.spec.test.alpha :as st]
[dda.build.devops.domain :as cut]))
(st/instrument `cut/build-path)
(st/instrument `cut/create-build-dir-command)
(deftest should-calculate-build-path
(is (= "../../target/dda-backup"
(cut/build-path {:name "dda-backup"
:project-root-path "../.."
:build-dir-name "target"
:version "4.11.8-dev"
:stage "dev"
:debug false
:dry-run false})))
(is (= "../../target/dda/backup"
(cut/build-path {:name "dda"
:module "backup"
:project-root-path "../.."
:build-dir-name "target"
:version "4.11.8-dev"
:stage "dev"
:debug false
:dry-run false}))))
(deftest should-calculate-clean-build-dir-command
(is (= ["rm" "-rf" "../../target/dda-backup"]
(cut/clean-build-dir-command {:name "dda-backup"
:project-root-path "../.."
:build-dir-name "target"
:version "4.11.8-dev"
:stage "dev"
:debug false
:dry-run false}))))
(deftest should-calculate-create-build-dir-command
(is (= ["mkdir" "-p" "../../target/dda-backup"]
(cut/create-build-dir-command {:name "dda-backup"
:project-root-path "../.."
:build-dir-name "target"
:version "4.11.8-dev"
:stage "dev"
:debug false
:dry-run false}))))