forked from technomancy/leiningen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_install.clj
25 lines (19 loc) · 864 Bytes
/
test_install.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
(ns test-install
(:use [leiningen.core :only [read-project defproject home-dir]]
[leiningen.install] :reload)
(:use [clojure.test]
[clojure.java.io :only [file]]
[leiningen.util.file :only [delete-file-recursively]]))
(def local-repo (file (System/getProperty "user.home") ".m2" "repository"))
(def m2-dir (file local-repo "nomnomnom" "nomnomnom" "0.5.0-SNAPSHOT"))
(defonce test-project (read-project "test_projects/sample/project.clj"))
(deftest test-install
(delete-file-recursively m2-dir true)
(install test-project)
(is (not (empty? (.listFiles m2-dir)))))
(def jdom-dir (file local-repo "jdom" "jdom" "1.0"))
(deftest test-standalone-install
(delete-file-recursively jdom-dir true)
(install "nomnomnom" "0.5.0-SNAPSHOT")
(is (not (empty? (.listFiles jdom-dir))))
(is (.exists (file (home-dir) "bin" "nom"))))