Tech behind Tech

Raw information. No finesse :)

Marking tests as pending in clojure

leave a comment »

I recently wrote a small macro to mark any tests in clojure as pending. It is very simple one. All you have to do is change deftest to deftest-pending. When you run all tests this macro instead of running those pending tests it will print name of pending tests.

Try it out

;; A Simple macro that enable to mark your test
;; to pending
(defmacro deftest-pending [name & body]
 (let [message (str "\n========\n" name " is pending !!\n========\n")]
   `(deftest ~name
         (println ~message))))

Written by Siva Jagadeesan

June 1, 2010 at 9:30 pm

Posted in Clojure

Tagged with ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 147 other followers

%d bloggers like this: