Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix PLUGINS.md hooks example; that was ridiculous.

  • Loading branch information...
commit acd6b1de0b5b028de5a145693161c1616d063af7 1 parent 5f54172
@technomancy authored
Showing with 13 additions and 7 deletions.
  1. +13 −7 doc/PLUGINS.md
View
20 doc/PLUGINS.md
@@ -82,13 +82,19 @@ etc. The add-hook function takes a var of the task it's meant to apply
to and a function to perform the wrapping:
```clj
-(use 'robert.hooke)
-
-(defn skip-integration-hook [task & args]
- (binding [clojure.test/test-var (test-var-skip :integration)]
- (apply task args)))
-
-(add-hook #'leiningen.test/test skip-integration-hook)
+(ns leiningen.hooks.integration
+ (:require [robert.hooke]
+ [leiningen.test]))
+
+(defn add-test-var-println [f & args]
+ `(binding [~'clojure.test/assert-expr
+ (fn [msg# form#]
+ (println "Asserting" form#)
+ ((.getRawRoot #'clojure.test/assert-expr) msg# form#))]
+ ~(apply f args)))
+
+(robert.hooke/add-hook #'leiningen.test/form-for-testing-namespaces
+ add-test-var-println)
```
Hooks compose, so be aware that your hook may be running inside
Please sign in to comment.
Something went wrong with that request. Please try again.