Repository navigation
Expand file tree
/
Copy pathrun.clj
More file actions
39 lines (32 loc) · 1.33 KB
/
Copy pathrun.clj
File metadata and controls
39 lines (32 loc) · 1.33 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
(ns leiningen.test.run
(:use [clojure.test]
[clojure.java.io :only [delete-file]]
[leiningen.core :only [read-project]]
[leiningen.javac :only [javac]]
[leiningen.run]
[leiningen.util.file :only [tmp-dir]]
[leiningen.test.helper :only [tricky-name-project dev-deps-project]]))
(def out-file (format "%s/lein-test" tmp-dir))
(use-fixtures :each (fn [f]
(f)
(delete-file out-file :silently)))
(deftest test-basic
(is (zero? (run tricky-name-project "/unreadable")))
(is (= "nom:/unreadable" (slurp out-file))))
(deftest test-alt-main
(is (zero? (run tricky-name-project "-m" "org.domain.tricky-name.munch"
"/unreadable")))
(is (= ":munched (\"/unreadable\")" (slurp out-file))))
(deftest test-aliases
(is (zero? (run tricky-name-project ":bbb" "/unreadable")))
(is (= "BRUNCH" (slurp out-file)))
(delete-file out-file :silently)
(is (zero? (run tricky-name-project ":mmm" "/unreadable")))
(is (= ":munched (\"/unreadable\")" (slurp out-file))))
(deftest test-escape-args
(is (zero? (run tricky-name-project "--" ":bbb")))
(is (= "nom::bbb" (slurp out-file)))
(is (zero? (run tricky-name-project "--" "-m")))
(is (= "nom:-m" (slurp out-file))))
(deftest test-run-java-main
(is (zero? (run dev-deps-project))))