2009-11-29 04:33:28 +00:00
|
|
|
(ns test-install
|
2010-08-31 05:11:18 +00:00
|
|
|
(:use [leiningen.core :only [read-project defproject home-dir]]
|
2010-09-09 04:05:03 +00:00
|
|
|
[leiningen.install] :reload)
|
2009-11-29 04:33:28 +00:00
|
|
|
(:use [clojure.test]
|
2010-09-09 04:05:03 +00:00
|
|
|
[clojure.java.io :only [file]]
|
|
|
|
[leiningen.util.file :only [delete-file-recursively]]))
|
2009-11-29 04:33:28 +00:00
|
|
|
|
2010-08-31 05:11:18 +00:00
|
|
|
(def local-repo (file (System/getProperty "user.home") ".m2" "repository"))
|
|
|
|
|
|
|
|
(def m2-dir (file local-repo "nomnomnom" "nomnomnom" "0.5.0-SNAPSHOT"))
|
2009-11-29 04:33:28 +00:00
|
|
|
|
2010-08-24 03:03:52 +00:00
|
|
|
(defonce test-project (read-project "test_projects/sample/project.clj"))
|
2009-11-29 04:33:28 +00:00
|
|
|
|
|
|
|
(deftest test-install
|
|
|
|
(delete-file-recursively m2-dir true)
|
|
|
|
(install test-project)
|
|
|
|
(is (not (empty? (.listFiles m2-dir)))))
|
2010-08-31 05:11:18 +00:00
|
|
|
|
|
|
|
(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"))))
|