From 18ca2247de8632ecbb5fcc971c194349d1836c10 Mon Sep 17 00:00:00 2001 From: Stuart Halloway Date: Sun, 25 Jan 2009 11:03:24 -0500 Subject: [PATCH] updated to match changes to test-is/are --- examples/build-clojure.clj | 16 +++++++--------- lancet/test/ant.clj | 4 ++-- lancet/test/coerce.clj | 6 +++--- lancet/test/lancet.clj | 6 +++--- lancet/test/runonce.clj | 10 +++++----- 5 files changed, 20 insertions(+), 22 deletions(-) diff --git a/examples/build-clojure.clj b/examples/build-clojure.clj index 7b3ce8c..99cf85b 100644 --- a/examples/build-clojure.clj +++ b/examples/build-clojure.clj @@ -1,6 +1,4 @@ (use 'lancet) -(require 'lancet.ant) -(alias 'ant 'lancet.ant) (def src "src") (def jsrc (str src "/jvm")) @@ -11,28 +9,28 @@ (deftarget test-target "Simple echo to test plumbing" - (ant/echo {:message "test target"})) + (echo {:message "test target"})) (deftarget init - (ant/tstamp) - (ant/mkdir {:dir build})) + (tstamp {}) + (mkdir {:dir build})) (deftarget compile "Compile Java sources." (init) - (ant/javac {:srcdir jsrc :destdir build + (javac {:srcdir jsrc :destdir build :includejavaruntime "yes" :debug "true" :target "1.5"})) (deftarget clean "Remove autogenerated files and directories" - (ant/delete {:dir build})) + (delete {:dir build})) -(deftarget jar +(deftarget make-jar "Create jar file." (compile) - (ant/jar {:jarfile clojure_jar + (jar {:jarfile clojure_jar :basedir build})) ;; TODO: tie together ant tasks and subsidiary data types diff --git a/lancet/test/ant.clj b/lancet/test/ant.clj index 5d2ba04..b21b878 100644 --- a/lancet/test/ant.clj +++ b/lancet/test/ant.clj @@ -10,9 +10,9 @@ (deftest test-ant-project (let [listeners (.getBuildListeners ant-project)] - (are = + (is (= (count (filter #(= (class %) org.apache.tools.ant.NoBannerLogger) listeners)) - 1 + 1) ))) (deftest test-instantiate-task diff --git a/lancet/test/coerce.clj b/lancet/test/coerce.clj index 009dfe7..009d123 100644 --- a/lancet/test/coerce.clj +++ b/lancet/test/coerce.clj @@ -3,7 +3,7 @@ (:use lancet)) (deftest boolean-coerce - (are = + (are (= _1 _2) (coerce Boolean/TYPE "yes") true (coerce Boolean/TYPE "YES") true (coerce Boolean/TYPE "on") true @@ -14,9 +14,9 @@ (coerce Boolean/TYPE "foo") false)) (deftest file-coerce - (are = + (are (= _1 _2) (coerce java.io.File "foo") (java.io.File. "foo"))) (deftest default-coerce - (are = + (are (= _1 _2) (coerce Comparable 10) 10)) \ No newline at end of file diff --git a/lancet/test/lancet.clj b/lancet/test/lancet.clj index e0dcd37..7392fe9 100644 --- a/lancet/test/lancet.clj +++ b/lancet/test/lancet.clj @@ -14,17 +14,17 @@ (deftest test-task-names (let [some-names #{'echo 'mkdir}] - (are = + (are (= _1 _2) (intersection (into #{} (task-names)) some-names) some-names))) (deftest test-safe-ant-name - (are = + (are (= _1 _2) (safe-ant-name 'echo) 'echo (safe-ant-name 'import) 'ant-import)) (deftest test-define-all-ant-tasks-defines-echo (let [echo-task (echo {:description "foo"})] - (are = + (are (= _1 _2) (.getDescription echo-task) "foo" (class echo-task) org.apache.tools.ant.taskdefs.Echo))) \ No newline at end of file diff --git a/lancet/test/runonce.clj b/lancet/test/runonce.clj index cff8ba0..4003d37 100644 --- a/lancet/test/runonce.clj +++ b/lancet/test/runonce.clj @@ -13,30 +13,30 @@ ; TODO: add nested contexts to test-is, a la PCL ; initial state - (are = + (are (= _1 _2) (has-run?) false @counter 0) ; run the fn (f) - (are = + (are (= _1 _2) (has-run?) true @counter 1) ; run the fn again (no change) (f) - (are = + (are (= _1 _2) (has-run?) true @counter 1) ; reset the fn (reset) - (are = + (are (= _1 _2) (has-run?) false) ; run the fn again (f) - (are = + (are (= _1 _2) (has-run?) true @counter 2) ))