diff --git a/test/leiningen/test/helper.clj b/test/leiningen/test/helper.clj index 112d7515..2d5ad516 100644 --- a/test/leiningen/test/helper.clj +++ b/test/leiningen/test/helper.clj @@ -28,6 +28,8 @@ (def sample-no-aot-project (read-test-project "sample-no-aot")) +(def sample-with-project (read-test-project "sample-with-project-profile")) + (def tricky-name-project (read-test-project "tricky-name")) (def native-project (read-test-project "native")) diff --git a/test/leiningen/test/pom.clj b/test/leiningen/test/pom.clj index 85803581..2046b60f 100644 --- a/test/leiningen/test/pom.clj +++ b/test/leiningen/test/pom.clj @@ -3,7 +3,8 @@ [clojure.java.io :only [file delete-file]] [leiningen.pom :only [make-pom pom]] [leiningen.core.user :as user] - [leiningen.test.helper :only [sample-project] :as lthelper]) + [leiningen.test.helper :only [sample-project sample-with-project] + :as lthelper]) (:require [clojure.data.xml :as xml] [leiningen.core.project :as project] [leiningen.core.main :as main])) @@ -318,3 +319,10 @@ nrepls (filter #(re-find #"nrepl" (pr-str %)) deps) versions (map #(deep-content % [:dependency :version]) nrepls)] (is (= [["0.2.2"]] versions)))) + +(deftest test-project-profile + (let [p (make-pom sample-with-project) + deps (deep-content (xml/parse-str p) [:project :dependencies]) + clj-https (filter #(re-find #"clj-http" (pr-str %)) deps) + versions (map #(deep-content % [:dependency :version]) clj-https)] + (is (= [["1.0.0"]] versions)))) diff --git a/test_projects/sample-with-project-profile/project.clj b/test_projects/sample-with-project-profile/project.clj new file mode 100644 index 00000000..89321dd3 --- /dev/null +++ b/test_projects/sample-with-project-profile/project.clj @@ -0,0 +1,11 @@ +;; This project is used for leiningen's test suite, so don't change +;; any of these values without updating the relevant tests. If you +;; just want a basic project to work from, generate a new one with +;; "lein new". + +(def clj-version "1.3.0") + +(defproject nomnomnom "0.5.0-SNAPSHOT" + :description "A test project" + :plugins [[com.palletops/discovery-api "0.1.0"]] + :profiles {:project [:discovery-api]})