Permalink
Browse files

updated to match changes to test-is/are

  • Loading branch information...
1 parent 33c65f2 commit 18ca2247de8632ecbb5fcc971c194349d1836c10 @stuarthalloway committed Jan 25, 2009
Showing with 20 additions and 22 deletions.
  1. +7 −9 examples/build-clojure.clj
  2. +2 −2 lancet/test/ant.clj
  3. +3 −3 lancet/test/coerce.clj
  4. +3 −3 lancet/test/lancet.clj
  5. +5 −5 lancet/test/runonce.clj
View
@@ -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
View
@@ -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
View
@@ -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))
View
@@ -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)))
View
@@ -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)
))

0 comments on commit 18ca224

Please sign in to comment.