 (ns incise.deploy.workflows.git-branch-spec
-  (:require stefon.util
+  (:require [stefon.util :refer [temp-dir]]
             [speclj.core :refer :all]
             (clojure.java [io :refer [file]]
                          [shell :refer [with-sh-dir]])

  (it "binds *repo* to a Git instance"
    (should (instance? Git *repo*)))
  (it "binds *work-dir* to the working tree directory"
    (should (same-file? @repo-dir *work-dir*)))
  (it "binds *out-dir* to a directory nested within the git dir."
    (should (same-file? (file @repo-dir ".git/_incise") *out-dir*))))

(run-specs)

            [incise.deploy.workflows.git-branch :refer :all])
  (:import [org.eclipse.jgit.api Git]))

(def spec-temp-dir (partial temp-dir "incise-deploy-git-branch-spec"))

(defn- create-dummy-repo
  "Create a git repository in a temporary directory."
  []
  (let [tmp-dir (spec-temp-dir)
        repo (git-init tmp-dir)]
    (git-commit repo "Initial commit.")
    tmp-dir))

(describe "with-repo"
  (with repo-dir (create-dummy-repo))
