|
10 | 10 | (with-redefs [user/plugins (constantly {})] |
11 | 11 | (f)))) |
12 | 12 |
|
| 13 | +(def paths {:source-path ["src"], |
| 14 | + :test-path ["test"], |
| 15 | + :resources-path ["dev-resources" "resources"], |
| 16 | + :compile-path "classes", |
| 17 | + :native-path "native", |
| 18 | + :target-path "target"}) |
| 19 | + |
| 20 | +(def expected {:name "leiningen", :group "leiningen", |
| 21 | + :version "2.0.0-SNAPSHOT", |
| 22 | + :url "https://github.com/technomancy/leiningen" |
| 23 | + |
| 24 | + :disable-implicit-clean true, |
| 25 | + :eval-in :leiningen, |
| 26 | + :license {:name "Eclipse Public License"} |
| 27 | + |
| 28 | + :dependencies '[[leiningen-core "2.0.0-SNAPSHOT"] |
| 29 | + [clucy "0.2.2"] [lancet "1.0.1"] |
| 30 | + [robert/hooke "1.1.2"] |
| 31 | + [stencil "0.2.0"]], |
| 32 | + :twelve 12 ; testing unquote |
| 33 | + |
| 34 | + :repositories [["central" {:url "http://repo1.maven.org/maven2"}] |
| 35 | + ["clojars" {:url "http://clojars.org/repo/"}]]}) |
| 36 | + |
13 | 37 | (deftest test-read-project |
14 | | - (is (= {:name "leiningen", :group "leiningen", :version "2.0.0-SNAPSHOT", |
15 | | - :url "https://github.com/technomancy/leiningen" |
16 | | - |
17 | | - :source-path ["src"], |
18 | | - :compile-path "classes", |
19 | | - :test-path ["test"], |
20 | | - :resources-path ["dev-resources" "resources"], |
21 | | - :native-path "native", |
22 | | - :target-path "target", |
23 | | - |
24 | | - :disable-implicit-clean true, |
25 | | - :eval-in :leiningen, |
26 | | - :license {:name "Eclipse Public License"} |
27 | | - |
28 | | - :dependencies '[[leiningen-core "2.0.0-SNAPSHOT"] |
29 | | - [clucy "0.2.2"] [lancet "1.0.1"] |
30 | | - [robert/hooke "1.1.2"] |
31 | | - [stencil "0.2.0"]], |
32 | | - :twelve 12 ; testing unquote |
33 | | - |
34 | | - ;; wtf, (= [#"^\."] [#"^\."]) <- false |
35 | | - ;; :jar-exclusions [#"^\."], |
36 | | - ;; :uberjar-exclusions [#"^META-INF/DUMMY.SF"], |
37 | | - :repositories [["central" {:url "http://repo1.maven.org/maven2"}] |
38 | | - ["clojars" {:url "http://clojars.org/repo/"}]]} |
39 | | - (dissoc (read "dev-resources/p1.clj") |
40 | | - :description :root :jar-exclusions :uberjar-exclusions)))) |
| 38 | + (let [actual (read "dev-resources/p1.clj")] |
| 39 | + (doseq [[k v] expected] |
| 40 | + (is (= (k actual) v))) |
| 41 | + (doseq [[k path] paths |
| 42 | + :when (string? path)] |
| 43 | + (is (= (k actual) (str (:root actual) "/" path)))) |
| 44 | + (doseq [[k path] paths |
| 45 | + :when (coll? path)] |
| 46 | + (is (= (k actual) (for [p path] (str (:root actual) "/" p))))))) |
41 | 47 |
|
42 | 48 | ;; TODO: test omit-default |
43 | 49 | ;; TODO: test reading project that doesn't def project |
|
0 commit comments