Commit 7cfa5798 authored by Raymond Huang's avatar Raymond Huang

Add test for deploying to a file repo

parent bf7e029d
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
[ :only [file]] [ :only [file]]
[leiningen.deploy] [leiningen.deploy]
[leiningen.test.helper :only [delete-file-recursively [leiningen.test.helper :only [delete-file-recursively
tmp-dir sample-project]])) tmp-dir sample-project
(defn- repo-path (defn- repo-path
[relative-repo-path] [relative-repo-path]
...@@ -45,6 +46,21 @@ ...@@ -45,6 +46,21 @@
repo-path repo-url)}}) repo-path repo-url)}})
"deploy-only-repo"))) "deploy-only-repo")))
(deftest ^:online test-deploy-classifier
(testing "deployment with explicit file names uploads classifiers to repo"
(let [deploy-dir (repo-path "deploy-classifier")
project (assoc sample-deploy-project
{"snapshots" {:url (repo-url deploy-dir)}})]
(delete-file-recursively deploy-dir :silently)
(deploy project "snapshots"
(:version project)
(str (:root project) "/deploy-me-0.1.0-SNAPSHOT-fat.jarr"))
(let [dir (file deploy-dir "deploy-me/deploy-me/0.1.0-SNAPSHOT/")
files (.list dir)]
(is (seq (filter #(re-find #"deploy-me-0.1.0-[\d.]+-\d+-fat.jarr$" %) files)))))))
(deftest signing (deftest signing
(testing "GPG invocation" (testing "GPG invocation"
(is (= (signing-args "foo.jar" nil) (is (= (signing-args "foo.jar" nil)
...@@ -50,6 +50,8 @@ ...@@ -50,6 +50,8 @@
(def sample-fixture-error-project (read-test-project "sample-fixture-error")) (def sample-fixture-error-project (read-test-project "sample-fixture-error"))
(def sample-deploy-project (read-test-project "sample-deploy"))
(def tricky-name-project (read-test-project "tricky-name")) (def tricky-name-project (read-test-project "tricky-name"))
(def native-project (read-test-project "native")) (def native-project (read-test-project "native"))
(defproject deploy-me "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url ""}
:dependencies [[org.clojure/clojure "1.8.0"]])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment