Add simple test for :project profile in pom

This commit is contained in:
Hugo Duncan 2014-09-01 13:44:01 -04:00
parent a19633f341
commit 831d2cf0dd
3 changed files with 22 additions and 1 deletions

View file

@ -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"))

View file

@ -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))))

View file

@ -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]})