Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add some tests.

  • Loading branch information...
commit 1406b9c9b5fa0e771e8bdddc4b0478c835d6c038 1 parent 07469ad
Matjaz Gregoric authored
Showing with 24 additions and 0 deletions.
  1. +15 −0 test/leiningen/test/oneoff.clj
  2. +9 −0 test_projects/sample.clj
15 test/leiningen/test/oneoff.clj
View
@@ -0,0 +1,15 @@
+(ns leiningen.test.oneoff
+ (:use [leiningen.oneoff] :reload)
+ (:use [clojure.test]
+ [clojure.java.io :only [file delete-file]]))
+
+(def sample-project (file "test_projects/sample.clj"))
+(def output-file (file "test_projects/output"))
+
+(deftest test-execute-script
+ (delete-file output-file true)
+ (execute-script (.getCanonicalPath sample-project) "bake" "honk!")
+ (let [output (slurp output-file)]
+ (is (re-find #"1.3.0-alpha5" output))
+ (is (re-find #"\[\"bake\" \"honk!\"\]" output)))
+ (delete-file output-file))
9 test_projects/sample.clj
View
@@ -0,0 +1,9 @@
+(defdeps
+ [[org.clojure/clojure "1.3.0-alpha5"]])
+
+(ns sample1
+ (:use [clojure.java.io :only [file]]))
+
+(spit (file *file* "../output")
+ (str "Running sample.clj under clojure " (clojure-version) " "
+ "with arguments: " (prn-str *command-line-args*)))
Please sign in to comment.
Something went wrong with that request. Please try again.