Add simple test for :project profile in pom
Hugo Duncan
9 years ago
26 | 26 |
(def sample-failing-project (read-test-project "sample-failing"))
|
27 | 27 |
|
28 | 28 |
(def sample-no-aot-project (read-test-project "sample-no-aot"))
|
|
29 |
|
|
30 |
(def sample-with-project (read-test-project "sample-with-project-profile"))
|
29 | 31 |
|
30 | 32 |
(def tricky-name-project (read-test-project "tricky-name"))
|
31 | 33 |
|
2 | 2 |
[clojure.java.io :only [file delete-file]]
|
3 | 3 |
[leiningen.pom :only [make-pom pom]]
|
4 | 4 |
[leiningen.core.user :as user]
|
5 | |
[leiningen.test.helper :only [sample-project] :as lthelper])
|
|
5 |
[leiningen.test.helper :only [sample-project sample-with-project]
|
|
6 |
:as lthelper])
|
6 | 7 |
(:require [clojure.data.xml :as xml]
|
7 | 8 |
[leiningen.core.project :as project]
|
8 | 9 |
[leiningen.core.main :as main]))
|
|
317 | 318 |
nrepls (filter #(re-find #"nrepl" (pr-str %)) deps)
|
318 | 319 |
versions (map #(deep-content % [:dependency :version]) nrepls)]
|
319 | 320 |
(is (= [["0.2.2"]] versions))))
|
|
321 |
|
|
322 |
(deftest test-project-profile
|
|
323 |
(let [p (make-pom sample-with-project)
|
|
324 |
deps (deep-content (xml/parse-str p) [:project :dependencies])
|
|
325 |
clj-https (filter #(re-find #"clj-http" (pr-str %)) deps)
|
|
326 |
versions (map #(deep-content % [:dependency :version]) clj-https)]
|
|
327 |
(is (= [["1.0.0"]] versions))))
|
|
0 |
;; This project is used for leiningen's test suite, so don't change
|
|
1 |
;; any of these values without updating the relevant tests. If you
|
|
2 |
;; just want a basic project to work from, generate a new one with
|
|
3 |
;; "lein new".
|
|
4 |
|
|
5 |
(def clj-version "1.3.0")
|
|
6 |
|
|
7 |
(defproject nomnomnom "0.5.0-SNAPSHOT"
|
|
8 |
:description "A test project"
|
|
9 |
:plugins [[com.palletops/discovery-api "0.1.0"]]
|
|
10 |
:profiles {:project [:discovery-api]})
|