Skip to content

Commit

Permalink
Add simple test for :project profile in pom
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoduncan committed Sep 1, 2014
1 parent a19633f commit 831d2cf
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions test/leiningen/test/helper.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
10 changes: 9 additions & 1 deletion test/leiningen/test/pom.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
Expand Down Expand Up @@ -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))))
11 changes: 11 additions & 0 deletions test_projects/sample-with-project-profile/project.clj
Original file line number Diff line number Diff line change
@@ -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]})

0 comments on commit 831d2cf

Please sign in to comment.