leiningen/test/test_install.clj

26 lines
864 B
Clojure
Raw Normal View History

2009-11-29 04:33:28 +00:00
(ns test-install
(:use [leiningen.core :only [read-project defproject home-dir]]
[leiningen.install] :reload)
2009-11-29 04:33:28 +00:00
(:use [clojure.test]
[clojure.java.io :only [file]]
[leiningen.util.file :only [delete-file-recursively]]))
2009-11-29 04:33:28 +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
(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)))))
(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"))))