forked from technomancy/leiningen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
48 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,56 @@ | ||
(ns leiningen.test.install | ||
(:require [leiningen.core.user :as user]) | ||
(:use [clojure.test] | ||
[leiningen.install :exclude [tmp-dir]] | ||
[leiningen.install] | ||
[leiningen.test.helper] | ||
[clojure.java.io :only [file]])) | ||
|
||
(def unix-shell-wrapper (file (user/leiningen-home) "bin" "nom")) | ||
(def windows-shell-wrapper (file (user/leiningen-home) "bin" "nom.bat")) | ||
;; (def unix-shell-wrapper (file (user/leiningen-home) "bin" "nom")) | ||
;; (def windows-shell-wrapper (file (user/leiningen-home) "bin" "nom.bat")) | ||
|
||
(defn delete-shell-wrappers [] | ||
(.delete unix-shell-wrapper) | ||
(.delete windows-shell-wrapper)) | ||
;; (defn delete-shell-wrappers [] | ||
;; (.delete unix-shell-wrapper) | ||
;; (.delete windows-shell-wrapper)) | ||
|
||
(deftest test-install | ||
(delete-file-recursively (m2-dir "nomnomnom" "0.5.0-SNAPSHOT") true) | ||
(delete-shell-wrappers) | ||
;; (delete-shell-wrappers) | ||
(is (zero? (install sample-project))) | ||
(is (not (empty? (.listFiles (m2-dir "nomnomnom" "0.5.0-SNAPSHOT"))))) | ||
(is (.exists unix-shell-wrapper)) | ||
(if (= :windows (get-os)) | ||
(is (.exists windows-shell-wrapper)) | ||
(is (not (.exists windows-shell-wrapper))))) | ||
;; (is (.exists unix-shell-wrapper)) | ||
;; (if (= :windows (get-os)) | ||
;; (is (.exists windows-shell-wrapper)) | ||
;; (is (not (.exists windows-shell-wrapper)))) | ||
) | ||
|
||
(def jdom-dir (file local-repo "jdom" "jdom" "1.0")) | ||
|
||
(deftest test-standalone-install | ||
(delete-file-recursively jdom-dir true) | ||
(delete-shell-wrappers) | ||
(install "nomnomnom" "0.5.0-SNAPSHOT") | ||
;; (delete-shell-wrappers) | ||
(install nil "nomnomnom" "0.5.0-SNAPSHOT") | ||
(is (not (empty? (.listFiles jdom-dir)))) | ||
(is (.exists unix-shell-wrapper))) | ||
;; (is (.exists unix-shell-wrapper)) | ||
) | ||
|
||
(def tricky-m2-dir (file local-repo "org" "domain" "tricky-name" "1.0")) | ||
(def tricky-unix-shell-wrapper (file (user/leiningen-home) | ||
"bin" "tricky-name")) | ||
(def tricky-windows-shell-wrapper (file (user/leiningen-home) | ||
"bin" "tricky-name.bat")) | ||
;; (def tricky-unix-shell-wrapper (file (user/leiningen-home) | ||
;; "bin" "tricky-name")) | ||
;; (def tricky-windows-shell-wrapper (file (user/leiningen-home) | ||
;; "bin" "tricky-name.bat")) | ||
|
||
(defn delete-tricky-shell-wrappers [] | ||
(.delete tricky-unix-shell-wrapper) | ||
(.delete tricky-windows-shell-wrapper)) | ||
;; (defn delete-tricky-shell-wrappers [] | ||
;; (.delete tricky-unix-shell-wrapper) | ||
;; (.delete tricky-windows-shell-wrapper)) | ||
|
||
(deftest test-tricky-name-install | ||
(delete-file-recursively tricky-m2-dir true) | ||
(delete-shell-wrappers) | ||
;; (delete-shell-wrappers) | ||
(install tricky-name-project) | ||
(install "org.domain/tricky-name" "1.0") | ||
(install nil "org.domain/tricky-name" "1.0") | ||
(is (not (empty? (.listFiles tricky-m2-dir)))) | ||
(is (.exists tricky-unix-shell-wrapper)) | ||
(if (= :windows (get-os)) | ||
(is (.exists tricky-windows-shell-wrapper)) | ||
(is (not (.exists tricky-windows-shell-wrapper))))) | ||
|
||
(doseq [[_ var] (ns-publics *ns*)] (alter-meta! var assoc :busted true)) | ||
;; (is (.exists tricky-unix-shell-wrapper)) | ||
;; (if (= :windows (get-os)) | ||
;; (is (.exists tricky-windows-shell-wrapper)) | ||
;; (is (not (.exists tricky-windows-shell-wrapper)))) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters