Skip to content

Commit

Permalink
Add test for deploy task.
Browse files Browse the repository at this point in the history
  • Loading branch information
technomancy committed Jan 14, 2011
1 parent 59e18bb commit c112f60
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/test_deploy.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
(ns test-deploy
(:use [leiningen.deploy] :reload)
(:use [clojure.test]
[clojure.java.io :only [file]]
[leiningen.core :only [read-project defproject]]
[leiningen.util.file]))

(def test-project (read-project "test_projects/sample/project.clj"))

(deftest test-deploy
(delete-file-recursively "/tmp/lein-repo" :silently)
(deploy test-project "file:///tmp/lein-repo")
(let [dir (file "/tmp/lein-repo/nomnomnom/nomnomnom/0.5.0-SNAPSHOT/")
files (.list dir)
year (+ 1900 (.getYear (java.util.Date.)))]
(is (seq files))
;; TODO: this is vulnerable to the y3k bug!
(is (seq (filter #(re-find #"nomnomnom-0.5.0-2\d{7}\." %) files)))))

0 comments on commit c112f60

Please sign in to comment.