Permalink
Browse files

vars are allowed inside contexts

  • Loading branch information...
1 parent 9170236 commit 655337af8e435ebe92b1fe8917636d2886d9dcc6 @slagyr committed Oct 9, 2012
Showing with 6 additions and 1 deletion.
  1. +2 −1 examples/basics/calulator_spec.clj
  2. +4 −0 src/speclj/components.clj
@@ -2,10 +2,11 @@
(:use [speclj.core]))
-(declare ^:dynamic *the-answer*)
(describe "Calculator"
+ (declare ^:dynamic *the-answer*)
+
(before (println "A spec is about to be evaluated"))
(after (println "A spec has just been evaluated"))
(before-all (println "May the spec'ing begin!"))
@@ -13,6 +13,10 @@
(install [this description]
(throw (Exception. (str "Oops! It looks like you tried to add 'nil' to a spec. That's not allowed.")))))
+(extend-type clojure.lang.Var
+ SpecComponent
+ (install [this description] (comment "Vars are cool. Let them pass.")))
+
(extend-type clojure.lang.Seqable
SpecComponent
(install [this description]

0 comments on commit 655337a

Please sign in to comment.